File indexing completed on 2024-05-12 16:40:15

0001 /* This file is part of the KDE project
0002    Copyright (C) 2004 Adam Pigg <adam@piggz.co.uk>
0003    Copyright (C) 2004 Jarosław Staniek <staniek@kde.org>
0004    Copyright (C) 2005 Martin Ellis <kde@martinellis.co.uk>
0005 
0006    This program is free software; you can redistribute it and/or
0007    modify it under the terms of the GNU Library General Public
0008    License as published by the Free Software Foundation; either
0009    version 2 of the License, or (at your option) any later version.
0010 
0011    This program is distributed in the hope that it will be useful,
0012    but WITHOUT ANY WARRANTY; without even the implied warranty of
0013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014    Library General Public License for more details.
0015 
0016    You should have received a copy of the GNU Library General Public License
0017    along with this program; see the file COPYING.  If not, write to
0018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0019  * Boston, MA 02110-1301, USA.
0020 */
0021 
0022 #include "keximigratedata.h"
0023 
0024 using namespace KexiMigration;
0025 
0026 class Q_DECL_HIDDEN Data::Private
0027 {
0028 public:
0029     Private() {}
0030 
0031     KexiProjectData *destinationProjectData = nullptr;
0032 
0033     //! @c true if not only structure should be migrated but also data
0034     bool shouldCopyData = true;
0035 };
0036 
0037 Data::Data()
0038     : source(nullptr)
0039     , d(new Private)
0040 {
0041 }
0042 
0043 Data::~Data()
0044 {
0045     delete d;
0046 }
0047 
0048 KexiProjectData* Data::destinationProjectData()
0049 {
0050     return d->destinationProjectData;
0051 }
0052 
0053 const KexiProjectData* Data::destinationProjectData() const
0054 {
0055     return d->destinationProjectData;
0056 }
0057 
0058 void Data::setDestinationProjectData(KexiProjectData* destinationProjectData)
0059 {
0060     if (d->destinationProjectData && d->destinationProjectData != destinationProjectData) {
0061         delete d->destinationProjectData;
0062     }
0063     d->destinationProjectData = destinationProjectData;
0064 }
0065 
0066 QString Data::sourceDatabaseInfoString() const
0067 {
0068     return source ? KexiProjectData::infoString(sourceName, *source).toString(Kuit::PlainText)
0069                   : QString();
0070 }
0071 
0072 bool Data::shouldCopyData() const
0073 {
0074     return d->shouldCopyData;
0075 }
0076 
0077 void Data::setShouldCopyData(bool set)
0078 {
0079     d->shouldCopyData = set;
0080 }