summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-04-18 08:03:42 +0200
committerMontel Laurent <[email protected]>2017-04-18 08:03:42 +0200
commit035594a738d09dbe24988973da4b67a96570fa72 (patch)
tree3c0bb52aa6d8c65ba5cb2ed865575b5a56d32717
parent8c1262e1771c59e34544980b58c987ec69a5db1a (diff)
Move in own directory
-rw-r--r--src/CMakeLists.txt16
-rw-r--r--src/abstract/abstractaddressbook.cpp137
-rw-r--r--src/abstract/abstractaddressbook.h66
-rw-r--r--src/abstract/abstractbase.cpp59
-rw-r--r--src/abstract/abstractbase.h54
-rw-r--r--src/abstract/abstractcalendar.cpp57
-rw-r--r--src/abstract/abstractcalendar.h45
-rw-r--r--src/abstract/abstractimporter.cpp140
-rw-r--r--src/abstract/abstractimporter.h96
-rw-r--r--src/abstract/abstractsettings.cpp161
-rw-r--r--src/abstract/abstractsettings.h81
-rw-r--r--src/autodetect/selectcomponentpage.h2
-rw-r--r--src/importmailpluginmanager.cpp2
-rw-r--r--src/importwizard.h2
-rw-r--r--src/plugins/balsa/balsaaddressbook.h2
-rw-r--r--src/plugins/balsa/balsaimportdata.h2
-rw-r--r--src/plugins/balsa/balsasettings.h2
-rw-r--r--src/plugins/claws-mail/clawsmailimportdata.h2
-rw-r--r--src/plugins/evolutionv1/evolutionv1importdata.h2
-rw-r--r--src/plugins/evolutionv2/evolutionv2importdata.h2
-rw-r--r--src/plugins/evolutionv3/evolutionaddressbook.h2
-rw-r--r--src/plugins/evolutionv3/evolutioncalendar.h2
-rw-r--r--src/plugins/evolutionv3/evolutionsettings.h2
-rw-r--r--src/plugins/evolutionv3/evolutionv3importdata.h2
-rw-r--r--src/plugins/geary/gearyaddressbook.h2
-rw-r--r--src/plugins/geary/gearyimportdata.h2
-rw-r--r--src/plugins/geary/gearysettings.h2
-rw-r--r--src/plugins/icedove/icedoveimportdata.h2
-rw-r--r--src/plugins/mailapp/mailappimportdata.h2
-rw-r--r--src/plugins/oe/oeimportdata.h2
-rw-r--r--src/plugins/opera/operaaddressbook.h2
-rw-r--r--src/plugins/opera/operaimportdata.h2
-rw-r--r--src/plugins/opera/operasettings.h2
-rw-r--r--src/plugins/pmail/pmailimportdata.h2
-rw-r--r--src/plugins/pmail/pmailsettings.h2
-rw-r--r--src/plugins/sylpheed/sylpheedaddressbook.h2
-rw-r--r--src/plugins/sylpheed/sylpheedimportdata.h2
-rw-r--r--src/plugins/sylpheed/sylpheedsettings.h2
-rw-r--r--src/plugins/thebat/thebatimportdata.h2
-rw-r--r--src/plugins/thunderbird/thunderbirdaddressbook.h2
-rw-r--r--src/plugins/thunderbird/thunderbirdimportdata.h2
-rw-r--r--src/plugins/thunderbird/thunderbirdsettings.h2
-rw-r--r--src/plugins/trojita/trojitaaddressbook.h2
-rw-r--r--src/plugins/trojita/trojitaimportdata.h2
-rw-r--r--src/plugins/trojita/trojitasettings.h2
45 files changed, 940 insertions, 40 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3790979..4eabcec 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -16,6 +16,15 @@ set(libimportwizard_manual_SRCS
manual/manualselectfilterpage.cpp
)
+set(libimportwizard_abstract_SRCS
+ abstract/abstractimporter.cpp
+ abstract/abstractsettings.cpp
+ abstract/abstractaddressbook.cpp
+ abstract/abstractcalendar.cpp
+ abstract/abstractbase.cpp
+ )
+
+
set(libimportwizard_autodetect_SRCS
autodetect/widgets/selectprogramlistwidget.cpp
autodetect/importwizardutil.cpp
@@ -28,11 +37,6 @@ set(libimportwizard_autodetect_SRCS
autodetect/selectcomponentpage.cpp
autodetect/importfilterinfogui.cpp
autodetect/importcalendarpage.cpp
- autodetect/abstractimporter.cpp
- autodetect/abstractsettings.cpp
- autodetect/abstractaddressbook.cpp
- autodetect/abstractcalendar.cpp
- autodetect/abstractbase.cpp
)
@@ -55,7 +59,7 @@ file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/*-apps-kontact-import-wi
ecm_add_app_icon(importwizard_SRCS ICONS ${ICONS_SRCS})
-add_library(libimportwizard ${libimportwizard_autodetect_SRCS} ${libimportwizard_manual_SRCS} ${libimportwizard_SRCS})
+add_library(libimportwizard ${libimportwizard_autodetect_SRCS} ${libimportwizard_manual_SRCS} ${libimportwizard_SRCS} ${libimportwizard_abstract_SRCS})
generate_export_header(libimportwizard BASE_NAME libimportwizard)
diff --git a/src/abstract/abstractaddressbook.cpp b/src/abstract/abstractaddressbook.cpp
new file mode 100644
index 0000000..614bcd7
--- /dev/null
+++ b/src/abstract/abstractaddressbook.cpp
@@ -0,0 +1,137 @@
+/*
+ Copyright (C) 2012-2017 Montel Laurent <[email protected]>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#include "abstract/abstractaddressbook.h"
+#include "importwizard.h"
+#include "importaddressbookpage.h"
+
+#include <KContacts/Addressee>
+#include <kcontacts/contactgroup.h>
+#include <KLocalizedString>
+#include "importwizard_debug.h"
+#include <AkonadiCore/ItemCreateJob>
+#include <AkonadiCore/Item>
+#include <AkonadiWidgets/CollectionDialog>
+
+#include <QPointer>
+using namespace LibImportWizard;
+AbstractAddressBook::AbstractAddressBook(ImportWizard *parent)
+ : mImportWizard(parent), mCollection(-1)
+{
+}
+
+AbstractAddressBook::~AbstractAddressBook()
+{
+
+}
+
+bool AbstractAddressBook::selectAddressBook()
+{
+ addAddressBookImportInfo(i18n("Creating new contact..."));
+ if (!mCollection.isValid()) {
+ const QStringList mimeTypes(KContacts::Addressee::mimeType());
+ QPointer<Akonadi::CollectionDialog> dlg = new Akonadi::CollectionDialog(mImportWizard);
+ dlg->setMimeTypeFilter(mimeTypes);
+ dlg->setAccessRightsFilter(Akonadi::Collection::CanCreateItem);
+ dlg->setWindowTitle(i18n("Select Address Book"));
+ dlg->setDescription(i18n("Select the address book the new contact shall be saved in:"));
+
+ if (dlg->exec() == QDialog::Accepted && dlg) {
+ mCollection = dlg->selectedCollection();
+ } else {
+ addAddressBookImportError(i18n("Address Book was not selected."));
+ delete dlg;
+ return false;
+ }
+ delete dlg;
+ }
+ return true;
+}
+
+void AbstractAddressBook::createGroup(const KContacts::ContactGroup &group)
+{
+ if (selectAddressBook()) {
+ Akonadi::Item item;
+ item.setPayload<KContacts::ContactGroup>(group);
+ item.setMimeType(KContacts::ContactGroup::mimeType());
+
+ Akonadi::ItemCreateJob *job = new Akonadi::ItemCreateJob(item, mCollection);
+ connect(job, &Akonadi::ItemCreateJob::result, this, &AbstractAddressBook::slotStoreDone);
+ }
+}
+
+void AbstractAddressBook::addImportContactNote(KContacts::Addressee &address, const QString &applicationName)
+{
+ QString currentNote = address.note();
+ if (!currentNote.isEmpty()) {
+ currentNote += QLatin1Char('\n');
+ }
+ currentNote += i18n("Imported from \"%1\"", applicationName);
+ address.setNote(currentNote);
+}
+
+void AbstractAddressBook::createContact(const KContacts::Addressee &address)
+{
+ if (selectAddressBook()) {
+ Akonadi::Item item;
+ item.setPayload<KContacts::Addressee>(address);
+ item.setMimeType(KContacts::Addressee::mimeType());
+ Akonadi::ItemCreateJob *job = new Akonadi::ItemCreateJob(item, mCollection);
+ connect(job, &Akonadi::ItemCreateJob::result, this, &AbstractAddressBook::slotStoreDone);
+ }
+}
+
+void AbstractAddressBook::slotStoreDone(KJob *job)
+{
+ if (job->error()) {
+ qCDebug(IMPORTWIZARD_LOG) << " job->errorString() : " << job->errorString();
+ addAddressBookImportError(i18n("Error during contact creation: %1", job->errorString()));
+ return;
+ }
+ addAddressBookImportInfo(i18n("Contact creation complete"));
+}
+
+void AbstractAddressBook::addImportInfo(const QString &log)
+{
+ addAddressBookImportInfo(log);
+}
+
+void AbstractAddressBook::addImportError(const QString &log)
+{
+ addAddressBookImportError(log);
+}
+
+void AbstractAddressBook::addAddressBookImportInfo(const QString &log)
+{
+ if (mImportWizard) {
+ mImportWizard->importAddressBookPage()->addImportInfo(log);
+ }
+}
+
+void AbstractAddressBook::addAddressBookImportError(const QString &log)
+{
+ if (mImportWizard) {
+ mImportWizard->importAddressBookPage()->addImportError(log);
+ }
+}
+
+void AbstractAddressBook::cleanUp()
+{
+ mCollection = Akonadi::Collection();
+}
+
diff --git a/src/abstract/abstractaddressbook.h b/src/abstract/abstractaddressbook.h
new file mode 100644
index 0000000..22126d2
--- /dev/null
+++ b/src/abstract/abstractaddressbook.h
@@ -0,0 +1,66 @@
+/*
+ Copyright (C) 2012-2017 Montel Laurent <[email protected]>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef ABSTRACTADDRESSBOOK_H
+#define ABSTRACTADDRESSBOOK_H
+
+#include <AkonadiCore/Collection>
+#include "abstractbase.h"
+#include "libimportwizard_export.h"
+
+class ImportWizard;
+
+namespace KContacts
+{
+class Addressee;
+class ContactGroup;
+}
+
+class KJob;
+namespace LibImportWizard
+{
+class LIBIMPORTWIZARD_EXPORT AbstractAddressBook: public LibImportWizard::AbstractBase
+{
+ Q_OBJECT
+public:
+ explicit AbstractAddressBook(ImportWizard *parent);
+ ~AbstractAddressBook();
+
+protected:
+ void createGroup(const KContacts::ContactGroup &group);
+ void createContact(const KContacts::Addressee &address);
+
+ void addImportInfo(const QString &log) Q_DECL_OVERRIDE;
+ void addImportError(const QString &log) Q_DECL_OVERRIDE;
+
+ void addAddressBookImportInfo(const QString &log);
+ void addAddressBookImportError(const QString &log);
+ void cleanUp();
+ void addImportContactNote(KContacts::Addressee &address, const QString &applicationName);
+
+protected:
+ ImportWizard *mImportWizard;
+
+private:
+ void slotStoreDone(KJob *job);
+ bool selectAddressBook();
+ Akonadi::Collection mCollection;
+};
+}
+#endif // ABSTRACTADDRESSBOOK_H
diff --git a/src/abstract/abstractbase.cpp b/src/abstract/abstractbase.cpp
new file mode 100644
index 0000000..ae17a8f
--- /dev/null
+++ b/src/abstract/abstractbase.cpp
@@ -0,0 +1,59 @@
+/*
+ Copyright (C) 2012-2017 Montel Laurent <[email protected]>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "abstractbase.h"
+#include "PimCommonAkonadi/CreateResource"
+
+#include <KSharedConfig>
+
+#include <AkonadiCore/agenttype.h>
+#include <AkonadiCore/agentmanager.h>
+#include <AkonadiCore/agentinstancecreatejob.h>
+
+#include <QMetaMethod>
+
+using namespace Akonadi;
+using namespace LibImportWizard;
+AbstractBase::AbstractBase()
+{
+ mCreateResource = new PimCommon::CreateResource();
+ connect(mCreateResource, &PimCommon::CreateResource::createResourceInfo, this, &AbstractBase::slotCreateResourceInfo);
+ connect(mCreateResource, &PimCommon::CreateResource::createResourceError, this, &AbstractBase::slotCreateResourceError);
+}
+
+AbstractBase::~AbstractBase()
+{
+ delete mCreateResource;
+}
+
+QString LibImportWizard::AbstractBase::createResource(const QString &resources, const QString &name, const QMap<QString, QVariant> &settings)
+{
+ return mCreateResource->createResource(resources, name, settings);
+}
+
+void AbstractBase::slotCreateResourceError(const QString &msg)
+{
+ addImportError(msg);
+}
+
+void AbstractBase::slotCreateResourceInfo(const QString &msg)
+{
+ addImportInfo(msg);
+}
+
diff --git a/src/abstract/abstractbase.h b/src/abstract/abstractbase.h
new file mode 100644
index 0000000..3ba14b0
--- /dev/null
+++ b/src/abstract/abstractbase.h
@@ -0,0 +1,54 @@
+/*
+ Copyright (C) 2012-2017 Montel Laurent <[email protected]>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef ABSTRACTBASE_H
+#define ABSTRACTBASE_H
+
+#include <QObject>
+#include "libimportwizard_export.h"
+#include <QString>
+#include <QMap>
+#include <QVariant>
+
+namespace PimCommon
+{
+class CreateResource;
+}
+namespace LibImportWizard
+{
+class LIBIMPORTWIZARD_EXPORT AbstractBase : public QObject
+{
+ Q_OBJECT
+public:
+ explicit AbstractBase();
+ virtual ~AbstractBase();
+
+ QString createResource(const QString &resources, const QString &name, const QMap<QString, QVariant> &settings);
+
+protected:
+ virtual void addImportInfo(const QString &log) = 0;
+ virtual void addImportError(const QString &log) = 0;
+
+private:
+ void slotCreateResourceError(const QString &);
+ void slotCreateResourceInfo(const QString &);
+ PimCommon::CreateResource *mCreateResource;
+};
+}
+#endif // ABSTRACTBASE_H
diff --git a/src/abstract/abstractcalendar.cpp b/src/abstract/abstractcalendar.cpp
new file mode 100644
index 0000000..53a1cf7
--- /dev/null
+++ b/src/abstract/abstractcalendar.cpp
@@ -0,0 +1,57 @@
+/*
+ Copyright (C) 2012-2017 Montel Laurent <[email protected]>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "abstractcalendar.h"
+#include "importwizard.h"
+#include "importcalendarpage.h"
+
+#include <KConfigGroup>
+using namespace LibImportWizard;
+
+AbstractCalendar::AbstractCalendar(ImportWizard *parent)
+ : mImportWizard(parent)
+{
+}
+
+AbstractCalendar::~AbstractCalendar()
+{
+}
+
+void AbstractCalendar::addImportInfo(const QString &log)
+{
+ if (mImportWizard) {
+ mImportWizard->importCalendarPage()->addImportInfo(log);
+ }
+}
+
+void AbstractCalendar::addImportError(const QString &log)
+{
+ if (mImportWizard) {
+ mImportWizard->importCalendarPage()->addImportError(log);
+ }
+}
+
+//eventviewsrc for calendar color for example
+void AbstractCalendar::addEvenViewConfig(const QString &groupName, const QString &key, const QString &value)
+{
+ KSharedConfigPtr eventViewConfig = KSharedConfig::openConfig(QStringLiteral("eventviewsrc"));
+ KConfigGroup group = eventViewConfig->group(groupName);
+ group.writeEntry(key, value);
+ group.sync();
+}
diff --git a/src/abstract/abstractcalendar.h b/src/abstract/abstractcalendar.h
new file mode 100644
index 0000000..90319f0
--- /dev/null
+++ b/src/abstract/abstractcalendar.h
@@ -0,0 +1,45 @@
+/*
+ Copyright (C) 2012-2017 Montel Laurent <[email protected]>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef ABSTRACTCALENDAR_H
+#define ABSTRACTCALENDAR_H
+
+class ImportWizard;
+#include "abstractbase.h"
+#include "libimportwizard_export.h"
+#include <QString>
+namespace LibImportWizard
+{
+class LIBIMPORTWIZARD_EXPORT AbstractCalendar : public LibImportWizard::AbstractBase
+{
+ Q_OBJECT
+public:
+ explicit AbstractCalendar(ImportWizard *parent);
+ virtual ~AbstractCalendar();
+
+protected:
+ void addEvenViewConfig(const QString &groupName, const QString &key, const QString &value);
+ void addImportInfo(const QString &log) Q_DECL_OVERRIDE;
+ void addImportError(const QString &log) Q_DECL_OVERRIDE;
+
+private:
+ ImportWizard *mImportWizard;
+};
+}
+#endif // ABSTRACTCALENDAR_H
diff --git a/src/abstract/abstractimporter.cpp b/src/abstract/abstractimporter.cpp
new file mode 100644
index 0000000..e429ff6
--- /dev/null
+++ b/src/abstract/abstractimporter.cpp
@@ -0,0 +1,140 @@
+/*
+ Copyright (C) 2012-2017 Montel Laurent <[email protected]>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "abstractimporter.h"
+#include "importwizard.h"
+#include "importmailpage.h"
+#include "importfilterinfogui.h"
+#include "importfilterpage.h"
+#include "importsettingpage.h"
+#include "importcalendarpage.h"
+
+#include "mailimporter/filterinfo.h"
+#include "MailCommon/FilterManager"
+#include <MailImporterAkonadi/FilterImporterAkonadi>
+
+#include <QFile>
+
+using namespace LibImportWizard;
+
+AbstractImporter::AbstractImporter(QObject *parent)
+ : QObject(parent),
+ mImportWizard(nullptr)
+{
+}
+
+AbstractImporter::~AbstractImporter()
+{
+}
+
+bool AbstractImporter::importSettings()
+{
+ return false;
+}
+
+bool AbstractImporter::importMails()
+{
+ return false;
+}
+
+bool AbstractImporter::importFilters()
+{
+ return false;
+}
+
+bool AbstractImporter::importAddressBook()
+{
+ return false;
+}
+
+bool AbstractImporter::importCalendar()
+{
+ return false;
+}
+
+void AbstractImporter::initializeFilter(MailImporter::Filter &filter)
+{
+ MailImporter::FilterInfo *info = new MailImporter::FilterInfo();
+ ImportFilterInfoGui *infoGui = new ImportFilterInfoGui(mImportWizard->importMailPage());
+ info->setFilterInfoGui(infoGui);
+ info->clear(); // Clear info from last time
+ MailImporter::FilterImporterAkonadi *filterImporter = new MailImporter::FilterImporterAkonadi(info);
+ filterImporter->setRootCollection(mImportWizard->importMailPage()->selectedCollection());
+ filter.setFilterImporter(filterImporter);
+ filter.setFilterInfo(info);
+}
+
+bool AbstractImporter::addFilters(const QString &filterPath, MailCommon::FilterImporterExporter::FilterType type)
+{
+ if (QFileInfo::exists(filterPath)) {
+ bool canceled = false;
+ MailCommon::FilterImporterExporter importer(mImportWizard);
+ QList<MailCommon::MailFilter *> listFilter = importer.importFilters(canceled, type, filterPath);
+ appendFilters(listFilter);
+ if (canceled) {
+ addImportFilterInfo(i18n("Importing of filters was canceled."));
+ } else {
+ addImportFilterInfo(i18np("1 filter was imported from \"%2\"", "%1 filters were imported from \"%2\"", listFilter.count(), filterPath));
+ }
+ return true;
+ } else {
+ addImportFilterError(i18n("Filters file was not found"));
+ return true;
+ }
+}
+
+void AbstractImporter::appendFilters(const QList<MailCommon::MailFilter *> &filters)
+{
+ if (!filters.isEmpty()) {
+ MailCommon::FilterManager::instance()->appendFilters(filters, false);
+ }
+}
+
+void AbstractImporter::addImportFilterInfo(const QString &log) const
+{
+ if (mImportWizard) {
+ mImportWizard->importFilterPage()->addImportInfo(log);
+ }
+}
+
+void AbstractImporter::addImportFilterError(const QString &log) const
+{
+ if (mImportWizard) {
+ mImportWizard->importFilterPage()->addImportError(log);
+ }
+}
+
+void AbstractImporter::addImportSettingsInfo(const QString &log) const
+{
+ if (mImportWizard) {
+ mImportWizard->importSettingPage()->addImportError(log);
+ }
+}
+
+void AbstractImporter::addImportCalendarInfo(const QString &log) const
+{
+ if (mImportWizard) {
+ mImportWizard->importCalendarPage()->addImportError(log);
+ }
+}
+
+void AbstractImporter::setImportWizard(ImportWizard *importWizard)
+{
+ mImportWizard = importWizard;
+}
diff --git a/src/abstract/abstractimporter.h b/src/abstract/abstractimporter.h
new file mode 100644
index 0000000..d1c36ef
--- /dev/null
+++ b/src/abstract/abstractimporter.h
@@ -0,0 +1,96 @@
+/*
+ Copyright (C) 2012-2017 Montel Laurent <[email protected]>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef AbstractImporter_H
+#define AbstractImporter_H
+#include "MailCommon/FilterImporterExporter"
+#include "libimportwizard_export.h"
+
+class ImportWizard;
+namespace MailImporter
+{
+class FilterInfo;
+class Filter;
+}
+
+namespace MailCommon
+{
+class MailFilter;
+class FilterImporterExporter;
+}
+
+namespace LibImportWizard {
+class LIBIMPORTWIZARD_EXPORT AbstractImporter : public QObject
+{
+ Q_OBJECT
+public:
+ enum TypeSupportedOption {
+ None = 0,
+ Mails = 1,
+ Settings = 2,
+ Filters = 4,
+ AddressBooks = 8,
+ Calendars = 16
+ };
+
+ Q_DECLARE_FLAGS(TypeSupportedOptions, TypeSupportedOption)
+
+ explicit AbstractImporter(QObject *parent);
+ virtual ~AbstractImporter();
+
+ /**
+ * Return true if mail found on system
+ */
+ virtual bool foundMailer() const = 0;
+
+ /**
+ * Return type of data that we can import
+ */
+ virtual TypeSupportedOptions supportedOption() = 0;
+ /**
+ * Return name for plugins
+ */
+ virtual QString name() const = 0;
+
+ virtual bool importSettings();
+ virtual bool importMails();
+ virtual bool importFilters();
+ virtual bool importAddressBook();
+ virtual bool importCalendar();
+
+ void setImportWizard(ImportWizard *importWizard);
+
+protected:
+ //TODO we need to redefine it.
+ virtual void initializeFilter(MailImporter::Filter &filter);
+
+ void appendFilters(const QList<MailCommon::MailFilter *> &filters);
+ void addImportFilterInfo(const QString &log) const;
+ void addImportFilterError(const QString &log) const;
+ bool addFilters(const QString &filterPath, MailCommon::FilterImporterExporter::FilterType type);
+ void addImportSettingsInfo(const QString &log) const;
+ void addImportCalendarInfo(const QString &log) const;
+
+ QString mPath;
+ ImportWizard *mImportWizard;
+};
+}
+
+#endif /* AbstractImporter_H */
+
diff --git a/src/abstract/abstractsettings.cpp b/src/abstract/abstractsettings.cpp
new file mode 100644
index 0000000..81b0929
--- /dev/null
+++ b/src/abstract/abstractsettings.cpp
@@ -0,0 +1,161 @@
+/*
+ Copyright (C) 2012-2017 Montel Laurent <[email protected]>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#include "abstract/abstractsettings.h"
+#include "importwizard.h"
+#include "importsettingpage.h"
+
+#include <KIdentityManagement/kidentitymanagement/identitymanager.h>
+#include <KIdentityManagement/kidentitymanagement/identity.h>
+#include <mailtransport/transportmanager.h>
+
+#include <KLocalizedString>
+#include <KSharedConfig>
+
+#include <AkonadiCore/agenttype.h>
+#include <AkonadiCore/agentmanager.h>
+#include <AkonadiCore/agentinstancecreatejob.h>
+
+#include <QMetaMethod>
+
+using namespace Akonadi;
+
+AbstractSettings::AbstractSettings(ImportWizard *parent)
+ : mImportWizard(parent)
+{
+ mManager = KIdentityManagement::IdentityManager::self();
+ mKmailConfig = KSharedConfig::openConfig(QStringLiteral("kmail2rc"));
+}
+
+AbstractSettings::~AbstractSettings()
+{
+ syncKmailConfig();
+}
+
+KIdentityManagement::Identity *AbstractSettings::createIdentity(QString &name)
+{
+ name = uniqueIdentityName(name);
+ KIdentityManagement::Identity *identity = &mManager->newFromScratch(name);
+ addImportInfo(i18n("Setting up identity..."));
+ return identity;
+}
+
+void AbstractSettings::storeIdentity(KIdentityManagement::Identity *identity)
+{
+ mManager->setAsDefault(identity->uoid());
+ mManager->commit();
+ addImportInfo(i18n("Identity set up."));
+}
+
+QString AbstractSettings::uniqueIdentityName(const QString &name)
+{
+ QString newName(name);
+ int i = 0;
+ while (!mManager->isUnique(newName)) {
+ newName = QStringLiteral("%1_%2").arg(name).arg(i);
+ ++i;
+ }
+ return newName;
+}
+
+MailTransport::Transport *AbstractSettings::createTransport()
+{
+ MailTransport::Transport *mt = MailTransport::TransportManager::self()->createTransport();
+ addImportInfo(i18n("Setting up transport..."));
+ return mt;
+}
+
+void AbstractSettings::storeTransport(MailTransport::Transport *mt, bool isDefault)
+{
+ mt->forceUniqueName();
+ mt->save();
+ MailTransport::TransportManager::self()->addTransport(mt);
+ if (isDefault) {
+ MailTransport::TransportManager::self()->setDefaultTransport(mt->id());
+ }
+ addImportInfo(i18n("Transport set up."));
+}
+
+void AbstractSettings::addImportInfo(const QString &log)
+{
+ if (mImportWizard) {
+ mImportWizard->importSettingPage()->addImportInfo(log);
+ }
+}
+
+void AbstractSettings::addImportError(const QString &log)
+{
+ if (mImportWizard) {
+ mImportWizard->importSettingPage()->addImportError(log);
+ }
+}
+
+void AbstractSettings::addCheckMailOnStartup(const QString &agentIdentifyName, bool loginAtStartup)
+{
+ if (agentIdentifyName.isEmpty()) {
+ return;
+ }
+ const QString groupName = QStringLiteral("Resource %1").arg(agentIdentifyName);
+ addKmailConfig(groupName, QStringLiteral("CheckOnStartup"), loginAtStartup);
+}
+
+void AbstractSettings::addToManualCheck(const QString &agentIdentifyName, bool manualCheck)
+{
+ if (agentIdentifyName.isEmpty()) {
+ return;
+ }
+ const QString groupName = QStringLiteral("Resource %1").arg(agentIdentifyName);
+ addKmailConfig(groupName, QStringLiteral("IncludeInManualChecks"), manualCheck);
+}
+
+void AbstractSettings::addComposerHeaderGroup(const QString &groupName, const QString &name, const QString &value)
+{
+ KConfigGroup group = mKmailConfig->group(groupName);
+ group.writeEntry(QStringLiteral("name"), name);
+ group.writeEntry(QStringLiteral("value"), value);
+}
+
+void AbstractSettings::addKmailConfig(const QString &groupName, const QString &key, const QString &value)
+{
+ KConfigGroup group = mKmailConfig->group(groupName);
+ group.writeEntry(key, value);
+}
+
+void AbstractSettings::addKmailConfig(const QString &groupName, const QString &key, bool value)
+{
+ KConfigGroup group = mKmailConfig->group(groupName);
+ group.writeEntry(key, value);
+}
+
+void AbstractSettings::addKmailConfig(const QString &groupName, const QString &key, int value)
+{
+ KConfigGroup group = mKmailConfig->group(groupName);
+ group.writeEntry(key, value);
+}
+
+void AbstractSettings::syncKmailConfig()
+{
+ mKmailConfig->sync();
+}
+
+int AbstractSettings::readKmailSettings(const QString &groupName, const QString &key)
+{
+ KConfigGroup group = mKmailConfig->group(groupName);
+ int value = group.readEntry(key, -1);
+ return value;
+}
diff --git a/src/abstract/abstractsettings.h b/src/abstract/abstractsettings.h
new file mode 100644
index 0000000..717e038
--- /dev/null
+++ b/src/abstract/abstractsettings.h
@@ -0,0 +1,81 @@
+/*
+ Copyright (C) 2012-2017 Montel Laurent <[email protected]>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef ABSTRACTSETTINGS_H
+#define ABSTRACTSETTINGS_H
+
+#include "abstractbase.h"
+#include "libimportwizard_export.h"
+#include <KSharedConfig>
+#include <QMap>
+
+class ImportWizard;
+
+namespace KIdentityManagement
+{
+class Identity;
+class IdentityManager;
+}
+
+namespace MailTransport
+{
+class Transport;
+}
+
+class LIBIMPORTWIZARD_EXPORT AbstractSettings : public LibImportWizard::AbstractBase
+{
+ Q_OBJECT
+public:
+ explicit AbstractSettings(ImportWizard *parent);
+ ~AbstractSettings();
+
+protected:
+ void addImportInfo(const QString &log) Q_DECL_OVERRIDE;
+ void addImportError(const QString &log) Q_DECL_OVERRIDE;
+
+ void syncKmailConfig();
+
+ QString uniqueIdentityName(const QString &name);
+
+ QString createResource(const QString &resources, const QString &name, const QMap<QString, QVariant> &settings);
+
+ KIdentityManagement::Identity *createIdentity(QString &name);
+
+ MailTransport::Transport *createTransport();
+
+ void storeTransport(MailTransport::Transport *mt, bool isDefault = false);
+
+ void storeIdentity(KIdentityManagement::Identity *identity);
+
+ void addKmailConfig(const QString &groupName, const QString &key, const QString &value);
+ void addKmailConfig(const QString &groupName, const QString &key, bool value);
+ void addKmailConfig(const QString &groupName, const QString &key, int value);
+
+ void addComposerHeaderGroup(const QString &groupName, const QString &name, const QString &value);
+
+ void addCheckMailOnStartup(const QString &agentIdentifyName, bool loginAtStartup);
+ void addToManualCheck(const QString &agentIdentifyName, bool manualCheck);
+ int readKmailSettings(const QString &groupName, const QString &key);
+
+ ImportWizard *mImportWizard;
+ KIdentityManagement::IdentityManager *mManager;
+ KSharedConfigPtr mKmailConfig;
+};
+
+#endif // ABSTRACTSETTINGS_H
diff --git a/src/autodetect/selectcomponentpage.h b/src/autodetect/selectcomponentpage.h
index 54b3ae0..61bddff 100644
--- a/src/autodetect/selectcomponentpage.h
+++ b/src/autodetect/selectcomponentpage.h
@@ -20,7 +20,7 @@
#define SELECTCOMPONENTPAGE_H
#include <QWidget>
-#include "abstractimporter.h"
+#include "abstract/abstractimporter.h"
namespace Ui
{
diff --git a/src/importmailpluginmanager.cpp b/src/importmailpluginmanager.cpp
index 7203e36..cf7d6be 100644
--- a/src/importmailpluginmanager.cpp
+++ b/src/importmailpluginmanager.cpp
@@ -20,7 +20,7 @@
#include "importmailpluginmanager.h"
#include "importwizard_debug.h"
-#include "abstractimporter.h"
+#include "abstract/abstractimporter.h"
#include <KPluginMetaData>
#include <KPluginLoader>
diff --git a/src/importwizard.h b/src/importwizard.h
index d7cb1d3..8ce9388 100644
--- a/src/importwizard.h
+++ b/src/importwizard.h
@@ -19,7 +19,7 @@
#ifndef IMPORTWIZARD_H
#define IMPORTWIZARD_H
-#include "abstractimporter.h"
+#include "abstract/abstractimporter.h"
#include "libimportwizard_export.h"
#include <KAssistantDialog>
diff --git a/src/plugins/balsa/balsaaddressbook.h b/src/plugins/balsa/balsaaddressbook.h
index 84afca7..3c4a58a 100644
--- a/src/plugins/balsa/balsaaddressbook.h
+++ b/src/plugins/balsa/balsaaddressbook.h
@@ -20,7 +20,7 @@
#ifndef BalsaAddressBook_H
#define BalsaAddressBook_H
-#include "abstractaddressbook.h"
+#include "abstract/abstractaddressbook.h"
class ImportWizard;
class KConfigGroup;
diff --git a/src/plugins/balsa/balsaimportdata.h b/src/plugins/balsa/balsaimportdata.h
index 57e82c5..cb79802 100644
--- a/src/plugins/balsa/balsaimportdata.h
+++ b/src/plugins/balsa/balsaimportdata.h
@@ -19,7 +19,7 @@
#ifndef BalsaImportData_H
#define BalsaImportData_H
-#include "abstractimporter.h"
+#include "abstract/abstractimporter.h"
class ImportWizard;
class BalsaImportData : public LibImportWizard::AbstractImporter
diff --git a/src/plugins/balsa/balsasettings.h b/src/plugins/balsa/balsasettings.h
index 80a0602..d8dbe27 100644
--- a/src/plugins/balsa/balsasettings.h
+++ b/src/plugins/balsa/balsasettings.h
@@ -20,7 +20,7 @@
#ifndef BalsaSettings_H
#define BalsaSettings_H
-#include "abstractsettings.h"
+#include "abstract/abstractsettings.h"
class ImportWizard;
class KConfigGroup;
diff --git a/src/plugins/claws-mail/clawsmailimportdata.h b/src/plugins/claws-mail/clawsmailimportdata.h
index 0a81d81..e2dce18 100644
--- a/src/plugins/claws-mail/clawsmailimportdata.h
+++ b/src/plugins/claws-mail/clawsmailimportdata.h
@@ -19,7 +19,7 @@
#ifndef ClawsMailImportData_H
#define ClawsMailImportData_H
-#include "abstractimporter.h"
+#include "abstract/abstractimporter.h"
class ImportWizard;
class ClawsMailImportData : public LibImportWizard::AbstractImporter
diff --git a/src/plugins/evolutionv1/evolutionv1importdata.h b/src/plugins/evolutionv1/evolutionv1importdata.h
index d031711..dc3949b 100644
--- a/src/plugins/evolutionv1/evolutionv1importdata.h
+++ b/src/plugins/evolutionv1/evolutionv1importdata.h
@@ -19,7 +19,7 @@
#ifndef Evolutionv1ImportData_H
#define Evolutionv1ImportData_H
-#include "abstractimporter.h"
+#include "abstract/abstractimporter.h"
class ImportWizard;
class Evolutionv1ImportData : public LibImportWizard::AbstractImporter
diff --git a/src/plugins/evolutionv2/evolutionv2importdata.h b/src/plugins/evolutionv2/evolutionv2importdata.h
index c1cd92b..7aebbb1 100644
--- a/src/plugins/evolutionv2/evolutionv2importdata.h
+++ b/src/plugins/evolutionv2/evolutionv2importdata.h
@@ -19,7 +19,7 @@
#ifndef Evolutionv2ImportData_H
#define Evolutionv2ImportData_H
-#include "abstractimporter.h"
+#include "abstract/abstractimporter.h"
class ImportWizard;
class Evolutionv2ImportData : public LibImportWizard::AbstractImporter
diff --git a/src/plugins/evolutionv3/evolutionaddressbook.h b/src/plugins/evolutionv3/evolutionaddressbook.h
index 36f5eea..cb7a005 100644
--- a/src/plugins/evolutionv3/evolutionaddressbook.h
+++ b/src/plugins/evolutionv3/evolutionaddressbook.h
@@ -20,7 +20,7 @@
#ifndef EVOLUTIONADDRESSBOOK_H
#define EVOLUTIONADDRESSBOOK_H
-#include "abstractaddressbook.h"
+#include "abstract/abstractaddressbook.h"
class ImportWizard;
diff --git a/src/plugins/evolutionv3/evolutioncalendar.h b/src/plugins/evolutionv3/evolutioncalendar.h
index ec6ac1a..9a84e24 100644
--- a/src/plugins/evolutionv3/evolutioncalendar.h
+++ b/src/plugins/evolutionv3/evolutioncalendar.h
@@ -20,7 +20,7 @@
#ifndef EVOLUTIONCALENDAR_H
#define EVOLUTIONCALENDAR_H
-#include "abstractcalendar.h"
+#include "abstract/abstractcalendar.h"
class QDomElement;
diff --git a/src/plugins/evolutionv3/evolutionsettings.h b/src/plugins/evolutionv3/evolutionsettings.h
index 397ac6e..027d5fc 100644
--- a/src/plugins/evolutionv3/evolutionsettings.h
+++ b/src/plugins/evolutionv3/evolutionsettings.h
@@ -20,7 +20,7 @@
#ifndef EVOLUTIONSETTINGS_H
#define EVOLUTIONSETTINGS_H
-#include "abstractsettings.h"
+#include "abstract/abstractsettings.h"
#include <KIdentityManagement/kidentitymanagement/signature.h>
#include <QString>
diff --git a/src/plugins/evolutionv3/evolutionv3importdata.h b/src/plugins/evolutionv3/evolutionv3importdata.h
index 98f794a..36185e4 100644
--- a/src/plugins/evolutionv3/evolutionv3importdata.h
+++ b/src/plugins/evolutionv3/evolutionv3importdata.h
@@ -19,7 +19,7 @@
#ifndef Evolutionv3ImportData_H
#define Evolutionv3ImportData_H
-#include "abstractimporter.h"
+#include "abstract/abstractimporter.h"
class ImportWizard;
class Evolutionv3ImportData : public LibImportWizard::AbstractImporter
diff --git a/src/plugins/geary/gearyaddressbook.h b/src/plugins/geary/gearyaddressbook.h
index 3205758..516446b 100644
--- a/src/plugins/geary/gearyaddressbook.h
+++ b/src/plugins/geary/gearyaddressbook.h
@@ -20,7 +20,7 @@
#ifndef GearyAddressBook_H
#define GearyAddressBook_H
-#include "abstractaddressbook.h"
+#include "abstract/abstractaddressbook.h"
#include <QHash>
class QSettings;
diff --git a/src/plugins/geary/gearyimportdata.h b/src/plugins/geary/gearyimportdata.h
index 76e188f..c2ed05a 100644
--- a/src/plugins/geary/gearyimportdata.h
+++ b/src/plugins/geary/gearyimportdata.h
@@ -19,7 +19,7 @@
#ifndef GearyImportData_H
#define GearyImportData_H
-#include "abstractimporter.h"
+#include "abstract/abstractimporter.h"
class ImportWizard;
class GearyImportData : public LibImportWizard::AbstractImporter
diff --git a/src/plugins/geary/gearysettings.h b/src/plugins/geary/gearysettings.h
index a757865..c392448 100644
--- a/src/plugins/geary/gearysettings.h
+++ b/src/plugins/geary/gearysettings.h
@@ -20,7 +20,7 @@
#ifndef GearySettings_H
#define GearySettings_H
-#include "abstractsettings.h"
+#include "abstract/abstractsettings.h"
class ImportWizard;
class QSettings;
diff --git a/src/plugins/icedove/icedoveimportdata.h b/src/plugins/icedove/icedoveimportdata.h
index 247c8ae..4190132 100644
--- a/src/plugins/icedove/icedoveimportdata.h
+++ b/src/plugins/icedove/icedoveimportdata.h
@@ -19,7 +19,7 @@
#ifndef IcedoveImportData_H
#define IcedoveImportData_H
-#include "abstractimporter.h"
+#include "abstract/abstractimporter.h"
class ImportWizard;
class IcedoveImportData : public LibImportWizard::AbstractImporter
diff --git a/src/plugins/mailapp/mailappimportdata.h b/src/plugins/mailapp/mailappimportdata.h
index 09c3679..f778723 100644
--- a/src/plugins/mailapp/mailappimportdata.h
+++ b/src/plugins/mailapp/mailappimportdata.h
@@ -19,7 +19,7 @@
#ifndef MailAppImportData_H
#define MailAppImportData_H
-#include "abstractimporter.h"
+#include "abstract/abstractimporter.h"
class ImportWizard;
class MailAppImportData : public LibImportWizard::AbstractImporter
diff --git a/src/plugins/oe/oeimportdata.h b/src/plugins/oe/oeimportdata.h
index d107a12..ddd1807 100644
--- a/src/plugins/oe/oeimportdata.h
+++ b/src/plugins/oe/oeimportdata.h
@@ -19,7 +19,7 @@
#ifndef OeImportData_H
#define OeImportData_H
-#include "abstractimporter.h"
+#include "abstract/abstractimporter.h"
class ImportWizard;
class OeImportData : public LibImportWizard::AbstractImporter
diff --git a/src/plugins/opera/operaaddressbook.h b/src/plugins/opera/operaaddressbook.h
index 807b675..58a8848 100644
--- a/src/plugins/opera/operaaddressbook.h
+++ b/src/plugins/opera/operaaddressbook.h
@@ -20,7 +20,7 @@
#ifndef OPERAADDRESSBOOK_H
#define OPERAADDRESSBOOK_H
-#include "abstractaddressbook.h"
+#include "abstract/abstractaddressbook.h"
class ImportWizard;
diff --git a/src/plugins/opera/operaimportdata.h b/src/plugins/opera/operaimportdata.h
index a4eadbe..aadd9da 100644
--- a/src/plugins/opera/operaimportdata.h
+++ b/src/plugins/opera/operaimportdata.h
@@ -20,7 +20,7 @@
#ifndef OperaImportData_H
#define OperaImportData_H
-#include "abstractimporter.h"
+#include "abstract/abstractimporter.h"
class ImportWizard;
class OperaImportData : public LibImportWizard::AbstractImporter
diff --git a/src/plugins/opera/operasettings.h b/src/plugins/opera/operasettings.h
index 6a7aff5..71812e3 100644
--- a/src/plugins/opera/operasettings.h
+++ b/src/plugins/opera/operasettings.h
@@ -20,7 +20,7 @@
#ifndef OPERASETTINGS_H
#define OPERASETTINGS_H
-#include "abstractsettings.h"
+#include "abstract/abstractsettings.h"
class ImportWizard;
class KConfigGroup;
diff --git a/src/plugins/pmail/pmailimportdata.h b/src/plugins/pmail/pmailimportdata.h
index ebf7658..5fbd323 100644
--- a/src/plugins/pmail/pmailimportdata.h
+++ b/src/plugins/pmail/pmailimportdata.h
@@ -20,7 +20,7 @@
#ifndef PMailImportData_H
#define PMailImportData_H
-#include "abstractimporter.h"
+#include "abstract/abstractimporter.h"
class ImportWizard;
class PMailImportData : public LibImportWizard::AbstractImporter
diff --git a/src/plugins/pmail/pmailsettings.h b/src/plugins/pmail/pmailsettings.h
index 97edab1..0919810 100644
--- a/src/plugins/pmail/pmailsettings.h
+++ b/src/plugins/pmail/pmailsettings.h
@@ -20,7 +20,7 @@
#ifndef PMailSettings_H
#define PMailSettings_H
-#include "abstractsettings.h"
+#include "abstract/abstractsettings.h"
class ImportWizard;
class KConfigGroup;
diff --git a/src/plugins/sylpheed/sylpheedaddressbook.h b/src/plugins/sylpheed/sylpheedaddressbook.h
index b7bd8fa..6e18cb4 100644
--- a/src/plugins/sylpheed/sylpheedaddressbook.h
+++ b/src/plugins/sylpheed/sylpheedaddressbook.h
@@ -20,7 +20,7 @@
#ifndef SYLPHEEDADDRESSBOOK_H
#define SYLPHEEDADDRESSBOOK_H
-#include "abstractaddressbook.h"
+#include "abstract/abstractaddressbook.h"
#include <QHash>
#include <QDir>
class QString;
diff --git a/src/plugins/sylpheed/sylpheedimportdata.h b/src/plugins/sylpheed/sylpheedimportdata.h
index 449d87b..c8e94f3 100644
--- a/src/plugins/sylpheed/sylpheedimportdata.h
+++ b/src/plugins/sylpheed/sylpheedimportdata.h
@@ -19,7 +19,7 @@
#ifndef SylpheedImportData_H
#define SylpheedImportData_H
-#include "abstractimporter.h"
+#include "abstract/abstractimporter.h"
class ImportWizard;
class SylpheedImportData : public LibImportWizard::AbstractImporter
diff --git a/src/plugins/sylpheed/sylpheedsettings.h b/src/plugins/sylpheed/sylpheedsettings.h
index f7b4ae7..1a7df3d 100644
--- a/src/plugins/sylpheed/sylpheedsettings.h
+++ b/src/plugins/sylpheed/sylpheedsettings.h
@@ -20,7 +20,7 @@
#ifndef SYLPHEEDSETTINGS_H
#define SYLPHEEDSETTINGS_H
-#include "abstractsettings.h"
+#include "abstract/abstractsettings.h"
#include <QString>
class ImportWizard;
diff --git a/src/plugins/thebat/thebatimportdata.h b/src/plugins/thebat/thebatimportdata.h
index f2db200..8a57b11 100644
--- a/src/plugins/thebat/thebatimportdata.h
+++ b/src/plugins/thebat/thebatimportdata.h
@@ -19,7 +19,7 @@
#ifndef TheBatImportData_H
#define TheBatImportData_H
-#include "abstractimporter.h"
+#include "abstract/abstractimporter.h"
class ImportWizard;
class TheBatImportData : public LibImportWizard::AbstractImporter
diff --git a/src/plugins/thunderbird/thunderbirdaddressbook.h b/src/plugins/thunderbird/thunderbirdaddressbook.h
index 38d3b19..108d943 100644
--- a/src/plugins/thunderbird/thunderbirdaddressbook.h
+++ b/src/plugins/thunderbird/thunderbirdaddressbook.h
@@ -20,7 +20,7 @@
#ifndef THUNDERBIRDADDRESSBOOK_H
#define THUNDERBIRDADDRESSBOOK_H
-#include "abstractaddressbook.h"
+#include "abstract/abstractaddressbook.h"
#include <QDir>
class ImportWizard;
diff --git a/src/plugins/thunderbird/thunderbirdimportdata.h b/src/plugins/thunderbird/thunderbirdimportdata.h
index 37772d7..a372716 100644
--- a/src/plugins/thunderbird/thunderbirdimportdata.h
+++ b/src/plugins/thunderbird/thunderbirdimportdata.h
@@ -19,7 +19,7 @@
#ifndef THUNDERBIRDIMPORTDATA_H
#define THUNDERBIRDIMPORTDATA_H
-#include "abstractimporter.h"
+#include "abstract/abstractimporter.h"
class ImportWizard;
class ThunderbirdImportData : public LibImportWizard::AbstractImporter
diff --git a/src/plugins/thunderbird/thunderbirdsettings.h b/src/plugins/thunderbird/thunderbirdsettings.h
index ec630c3..2f7df64 100644
--- a/src/plugins/thunderbird/thunderbirdsettings.h
+++ b/src/plugins/thunderbird/thunderbirdsettings.h
@@ -20,7 +20,7 @@
#ifndef THUNDERBIRDSETTINGS_H
#define THUNDERBIRDSETTINGS_H
-#include "abstractsettings.h"
+#include "abstract/abstractsettings.h"
#include "importwizardutil.h"
#include <QHash>
#include <QStringList>
diff --git a/src/plugins/trojita/trojitaaddressbook.h b/src/plugins/trojita/trojitaaddressbook.h
index 25f3f67..74c8233 100644
--- a/src/plugins/trojita/trojitaaddressbook.h
+++ b/src/plugins/trojita/trojitaaddressbook.h
@@ -20,7 +20,7 @@
#ifndef TrojitaAddressBook_H
#define TrojitaAddressBook_H
-#include "abstractaddressbook.h"
+#include "abstract/abstractaddressbook.h"
#include <QHash>
class QSettings;
diff --git a/src/plugins/trojita/trojitaimportdata.h b/src/plugins/trojita/trojitaimportdata.h
index 78c425f..a665fab 100644
--- a/src/plugins/trojita/trojitaimportdata.h
+++ b/src/plugins/trojita/trojitaimportdata.h
@@ -19,7 +19,7 @@
#ifndef TrojitaImportData_H
#define TrojitaImportData_H
-#include "abstractimporter.h"
+#include "abstract/abstractimporter.h"
class ImportWizard;
class TrojitaImportData : public LibImportWizard::AbstractImporter
diff --git a/src/plugins/trojita/trojitasettings.h b/src/plugins/trojita/trojitasettings.h
index 379fd1e..b8f6381 100644
--- a/src/plugins/trojita/trojitasettings.h
+++ b/src/plugins/trojita/trojitasettings.h
@@ -20,7 +20,7 @@
#ifndef TrojitaSettings_H
#define TrojitaSettings_H
-#include "abstractsettings.h"
+#include "abstract/abstractsettings.h"
class ImportWizard;
class QSettings;