summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-04-14 23:31:12 +0200
committerMontel Laurent <[email protected]>2017-04-14 23:31:12 +0200
commitd0462996f42477cdc6d8dfe3eb602adea13bf65b (patch)
treee84184e8e4394f155cc4e345592db5961a6b5370
parent4b8d6c72c67b81c01ca75fbdc9dfa377d9542e3d (diff)
Continue to implement plugin support
-rw-r--r--src/autodetect/abstractaddressbook.cpp8
-rw-r--r--src/autodetect/abstractaddressbook.h3
-rw-r--r--src/autodetect/abstractcalendar.h4
-rw-r--r--src/autodetect/abstractimporter.cpp27
-rw-r--r--src/autodetect/abstractimporter.h7
-rw-r--r--src/autodetect/abstractsettings.cpp8
-rw-r--r--src/autodetect/abstractsettings.h3
-rw-r--r--src/autodetect/balsa/balsaimportdata.cpp8
-rw-r--r--src/autodetect/balsa/balsaimportdata.h2
-rw-r--r--src/autodetect/balsa/balsaimporter.json10
-rw-r--r--src/autodetect/claws-mail/clawsmailimportdata.cpp7
-rw-r--r--src/autodetect/claws-mail/clawsmailimportdata.h2
-rw-r--r--src/autodetect/claws-mail/clawsmailimporter.json10
-rw-r--r--src/autodetect/evolutionv1/evolutionv1importdata.cpp3
-rw-r--r--src/autodetect/evolutionv1/evolutionv1importdata.h2
-rw-r--r--src/autodetect/evolutionv2/evolutionv2importdata.cpp3
-rw-r--r--src/autodetect/evolutionv2/evolutionv2importdata.h2
-rw-r--r--src/autodetect/evolutionv3/evolutionv3importdata.cpp2
-rw-r--r--src/autodetect/evolutionv3/evolutionv3importdata.h2
-rw-r--r--src/autodetect/geary/gearyimportdata.cpp8
-rw-r--r--src/autodetect/geary/gearyimportdata.h2
-rw-r--r--src/autodetect/geary/gearyimporter.json10
-rw-r--r--src/autodetect/icedove/icedoveimportdata.cpp3
-rw-r--r--src/autodetect/icedove/icedoveimportdata.h2
-rw-r--r--src/autodetect/mailapp/mailappimportdata.cpp4
-rw-r--r--src/autodetect/mailapp/mailappimportdata.h2
-rw-r--r--src/autodetect/oe/oeimportdata.cpp3
-rw-r--r--src/autodetect/oe/oeimportdata.h2
-rw-r--r--src/autodetect/opera/operaimportdata.cpp4
-rw-r--r--src/autodetect/opera/operaimportdata.h2
-rw-r--r--src/autodetect/pmail/pmailimportdata.cpp4
-rw-r--r--src/autodetect/pmail/pmailimportdata.h2
-rw-r--r--src/autodetect/sylpheed/sylpheedimportdata.cpp4
-rw-r--r--src/autodetect/sylpheed/sylpheedimportdata.h2
-rw-r--r--src/autodetect/thebat/thebatimportdata.cpp3
-rw-r--r--src/autodetect/thebat/thebatimportdata.h2
-rw-r--r--src/autodetect/thunderbird/thunderbirdimportdata.cpp3
-rw-r--r--src/autodetect/thunderbird/thunderbirdimportdata.h2
-rw-r--r--src/autodetect/trojita/trojitaimportdata.cpp3
-rw-r--r--src/autodetect/trojita/trojitaimportdata.h2
-rw-r--r--src/importmailpluginmanager.cpp13
-rw-r--r--src/importwizard.cpp66
42 files changed, 186 insertions, 75 deletions
diff --git a/src/autodetect/abstractaddressbook.cpp b/src/autodetect/abstractaddressbook.cpp
index f23d450..b458c92 100644
--- a/src/autodetect/abstractaddressbook.cpp
+++ b/src/autodetect/abstractaddressbook.cpp
@@ -118,12 +118,16 @@ void AbstractAddressBook::addImportError(const QString &log)
void AbstractAddressBook::addAddressBookImportInfo(const QString &log)
{
- mImportWizard->importAddressBookPage()->addImportInfo(log);
+ if (mImportWizard) {
+ mImportWizard->importAddressBookPage()->addImportInfo(log);
+ }
}
void AbstractAddressBook::addAddressBookImportError(const QString &log)
{
- mImportWizard->importAddressBookPage()->addImportError(log);
+ if (mImportWizard) {
+ mImportWizard->importAddressBookPage()->addImportError(log);
+ }
}
void AbstractAddressBook::cleanUp()
diff --git a/src/autodetect/abstractaddressbook.h b/src/autodetect/abstractaddressbook.h
index ecb61de..75cc9ef 100644
--- a/src/autodetect/abstractaddressbook.h
+++ b/src/autodetect/abstractaddressbook.h
@@ -22,6 +22,7 @@
#include <AkonadiCore/Collection>
#include "abstractbase.h"
+#include "libimportwizard_export.h"
class ImportWizard;
@@ -33,7 +34,7 @@ class ContactGroup;
class KJob;
-class AbstractAddressBook: public AbstractBase
+class LIBIMPORTWIZARD_EXPORT AbstractAddressBook: public AbstractBase
{
Q_OBJECT
public:
diff --git a/src/autodetect/abstractcalendar.h b/src/autodetect/abstractcalendar.h
index d3b8905..ccebd50 100644
--- a/src/autodetect/abstractcalendar.h
+++ b/src/autodetect/abstractcalendar.h
@@ -22,10 +22,10 @@
class ImportWizard;
#include "abstractbase.h"
-
+#include "libimportwizard_export.h"
#include <QString>
-class AbstractCalendar : public AbstractBase
+class LIBIMPORTWIZARD_EXPORT AbstractCalendar : public AbstractBase
{
Q_OBJECT
public:
diff --git a/src/autodetect/abstractimporter.cpp b/src/autodetect/abstractimporter.cpp
index edec736..2c10d7d 100644
--- a/src/autodetect/abstractimporter.cpp
+++ b/src/autodetect/abstractimporter.cpp
@@ -31,9 +31,9 @@
#include <QFile>
-AbstractImporter::AbstractImporter(ImportWizard *parent)
- : QObject(),
- mImportWizard(parent)
+AbstractImporter::AbstractImporter(QObject *parent)
+ : QObject(parent),
+ mImportWizard(nullptr)
{
}
@@ -106,20 +106,33 @@ void AbstractImporter::appendFilters(const QList<MailCommon::MailFilter *> &filt
void AbstractImporter::addImportFilterInfo(const QString &log) const
{
- mImportWizard->importFilterPage()->addImportInfo(log);
+ if (mImportWizard) {
+ mImportWizard->importFilterPage()->addImportInfo(log);
+ }
}
void AbstractImporter::addImportFilterError(const QString &log) const
{
- mImportWizard->importFilterPage()->addImportError(log);
+ if (mImportWizard) {
+ mImportWizard->importFilterPage()->addImportError(log);
+ }
}
void AbstractImporter::addImportSettingsInfo(const QString &log) const
{
- mImportWizard->importSettingPage()->addImportError(log);
+ if (mImportWizard) {
+ mImportWizard->importSettingPage()->addImportError(log);
+ }
}
void AbstractImporter::addImportCalendarInfo(const QString &log) const
{
- mImportWizard->importCalendarPage()->addImportError(log);
+ if (mImportWizard) {
+ mImportWizard->importCalendarPage()->addImportError(log);
+ }
+}
+
+void AbstractImporter::setImportWizard(ImportWizard *importWizard)
+{
+ mImportWizard = importWizard;
}
diff --git a/src/autodetect/abstractimporter.h b/src/autodetect/abstractimporter.h
index 8bb1ade..e3f4f67 100644
--- a/src/autodetect/abstractimporter.h
+++ b/src/autodetect/abstractimporter.h
@@ -20,6 +20,7 @@
#ifndef AbstractImporter_H
#define AbstractImporter_H
#include "MailCommon/FilterImporterExporter"
+#include "libimportwizard_export.h"
class ImportWizard;
@@ -35,7 +36,7 @@ class MailFilter;
class FilterImporterExporter;
}
-class AbstractImporter : public QObject
+class LIBIMPORTWIZARD_EXPORT AbstractImporter : public QObject
{
Q_OBJECT
public:
@@ -50,7 +51,7 @@ public:
Q_DECLARE_FLAGS(TypeSupportedOptions, TypeSupportedOption)
- explicit AbstractImporter(ImportWizard *parent);
+ explicit AbstractImporter(QObject *parent);
virtual ~AbstractImporter();
/**
@@ -73,6 +74,8 @@ public:
virtual bool importAddressBook();
virtual bool importCalendar();
+ void setImportWizard(ImportWizard *importWizard);
+
protected:
//TODO we need to redefine it.
virtual void initializeFilter(MailImporter::Filter &filter);
diff --git a/src/autodetect/abstractsettings.cpp b/src/autodetect/abstractsettings.cpp
index 2bf568b..b41aa68 100644
--- a/src/autodetect/abstractsettings.cpp
+++ b/src/autodetect/abstractsettings.cpp
@@ -93,12 +93,16 @@ void AbstractSettings::storeTransport(MailTransport::Transport *mt, bool isDefau
void AbstractSettings::addImportInfo(const QString &log)
{
- mImportWizard->importSettingPage()->addImportInfo(log);
+ if (mImportWizard) {
+ mImportWizard->importSettingPage()->addImportInfo(log);
+ }
}
void AbstractSettings::addImportError(const QString &log)
{
- mImportWizard->importSettingPage()->addImportError(log);
+ if (mImportWizard) {
+ mImportWizard->importSettingPage()->addImportError(log);
+ }
}
void AbstractSettings::addCheckMailOnStartup(const QString &agentIdentifyName, bool loginAtStartup)
diff --git a/src/autodetect/abstractsettings.h b/src/autodetect/abstractsettings.h
index 522c928..f6bf68d 100644
--- a/src/autodetect/abstractsettings.h
+++ b/src/autodetect/abstractsettings.h
@@ -21,6 +21,7 @@
#define ABSTRACTSETTINGS_H
#include "abstractbase.h"
+#include "libimportwizard_export.h"
#include <KSharedConfig>
#include <QMap>
@@ -37,7 +38,7 @@ namespace MailTransport
class Transport;
}
-class AbstractSettings : public AbstractBase
+class LIBIMPORTWIZARD_EXPORT AbstractSettings : public AbstractBase
{
Q_OBJECT
public:
diff --git a/src/autodetect/balsa/balsaimportdata.cpp b/src/autodetect/balsa/balsaimportdata.cpp
index 46c85dc..7755ef3 100644
--- a/src/autodetect/balsa/balsaimportdata.cpp
+++ b/src/autodetect/balsa/balsaimportdata.cpp
@@ -27,10 +27,12 @@
#include "importwizard.h"
#include <KLocalizedString>
-
+#include <kpluginfactory.h>
#include <QDir>
-BalsaImportData::BalsaImportData(ImportWizard *parent)
+//K_PLUGIN_FACTORY_WITH_JSON(BalsaImporterFactory, "balsaimporter.json", registerPlugin<BalsaImportData>();)
+
+BalsaImportData::BalsaImportData(QObject *parent, const QList<QVariant> &)
: AbstractImporter(parent)
{
mPath = MailImporter::FilterBalsa::defaultSettingsPath();
@@ -100,3 +102,5 @@ AbstractImporter::TypeSupportedOptions BalsaImportData::supportedOption()
options |= AbstractImporter::Filters;
return options;
}
+
+#include "balsaimportdata.moc"
diff --git a/src/autodetect/balsa/balsaimportdata.h b/src/autodetect/balsa/balsaimportdata.h
index fc98816..502f8a6 100644
--- a/src/autodetect/balsa/balsaimportdata.h
+++ b/src/autodetect/balsa/balsaimportdata.h
@@ -25,7 +25,7 @@ class ImportWizard;
class BalsaImportData : public AbstractImporter
{
public:
- explicit BalsaImportData(ImportWizard *parent);
+ explicit BalsaImportData(QObject *parent, const QList<QVariant> & = QList<QVariant>());
~BalsaImportData();
TypeSupportedOptions supportedOption() Q_DECL_OVERRIDE;
diff --git a/src/autodetect/balsa/balsaimporter.json b/src/autodetect/balsa/balsaimporter.json
new file mode 100644
index 0000000..b3c3f0e
--- /dev/null
+++ b/src/autodetect/balsa/balsaimporter.json
@@ -0,0 +1,10 @@
+{
+ "KPlugin": {
+ "Id": "balsaimporter",
+ "Name": "Balsa Importer",
+ "ServiceTypes": [
+ "ImportWizard/PluginMailImporter"
+ ],
+ "Version": "1.0"
+ }
+}
diff --git a/src/autodetect/claws-mail/clawsmailimportdata.cpp b/src/autodetect/claws-mail/clawsmailimportdata.cpp
index 17ce6ea..4062e13 100644
--- a/src/autodetect/claws-mail/clawsmailimportdata.cpp
+++ b/src/autodetect/claws-mail/clawsmailimportdata.cpp
@@ -26,11 +26,14 @@
#include "importfilterinfogui.h"
#include "importwizard.h"
+#include <kpluginfactory.h>
#include <KLocalizedString>
#include <QDir>
-ClawsMailImportData::ClawsMailImportData(ImportWizard *parent)
+//K_PLUGIN_FACTORY_WITH_JSON(ClawsMailImporterFactory, "clawsmailimporter.json", registerPlugin<ClawsMailImportData>();)
+
+ClawsMailImportData::ClawsMailImportData(QObject *parent, const QList<QVariant> &)
: AbstractImporter(parent)
{
mPath = MailImporter::FilterClawsMail::defaultSettingsPath();
@@ -105,3 +108,5 @@ AbstractImporter::TypeSupportedOptions ClawsMailImportData::supportedOption()
options |= AbstractImporter::Filters;
return options;
}
+
+#include "clawsmailimportdata.moc"
diff --git a/src/autodetect/claws-mail/clawsmailimportdata.h b/src/autodetect/claws-mail/clawsmailimportdata.h
index cb604bc..1877b91 100644
--- a/src/autodetect/claws-mail/clawsmailimportdata.h
+++ b/src/autodetect/claws-mail/clawsmailimportdata.h
@@ -25,7 +25,7 @@ class ImportWizard;
class ClawsMailImportData : public AbstractImporter
{
public:
- explicit ClawsMailImportData(ImportWizard *parent);
+ explicit ClawsMailImportData(QObject *parent, const QList<QVariant> & = QList<QVariant>());
~ClawsMailImportData();
TypeSupportedOptions supportedOption() Q_DECL_OVERRIDE;
diff --git a/src/autodetect/claws-mail/clawsmailimporter.json b/src/autodetect/claws-mail/clawsmailimporter.json
new file mode 100644
index 0000000..0222a86
--- /dev/null
+++ b/src/autodetect/claws-mail/clawsmailimporter.json
@@ -0,0 +1,10 @@
+{
+ "KPlugin": {
+ "Id": "clawsmailimporter",
+ "Name": "ClawsMail Importer",
+ "ServiceTypes": [
+ "ImportWizard/PluginMailImporter"
+ ],
+ "Version": "1.0"
+ }
+}
diff --git a/src/autodetect/evolutionv1/evolutionv1importdata.cpp b/src/autodetect/evolutionv1/evolutionv1importdata.cpp
index fe7d72c..af11f3e 100644
--- a/src/autodetect/evolutionv1/evolutionv1importdata.cpp
+++ b/src/autodetect/evolutionv1/evolutionv1importdata.cpp
@@ -23,10 +23,11 @@
#include "importfilterinfogui.h"
#include <KLocalizedString>
+#include <kpluginfactory.h>
#include <QDir>
-Evolutionv1ImportData::Evolutionv1ImportData(ImportWizard *parent)
+Evolutionv1ImportData::Evolutionv1ImportData(QObject *parent, const QList<QVariant> &)
: AbstractImporter(parent)
{
mPath = MailImporter::FilterEvolution::defaultSettingsPath();
diff --git a/src/autodetect/evolutionv1/evolutionv1importdata.h b/src/autodetect/evolutionv1/evolutionv1importdata.h
index 4bb06f4..7dab2a0 100644
--- a/src/autodetect/evolutionv1/evolutionv1importdata.h
+++ b/src/autodetect/evolutionv1/evolutionv1importdata.h
@@ -25,7 +25,7 @@ class ImportWizard;
class Evolutionv1ImportData : public AbstractImporter
{
public:
- explicit Evolutionv1ImportData(ImportWizard *parent);
+ explicit Evolutionv1ImportData(QObject *parent, const QList<QVariant> & = QList<QVariant>());
~Evolutionv1ImportData();
TypeSupportedOptions supportedOption() Q_DECL_OVERRIDE;
diff --git a/src/autodetect/evolutionv2/evolutionv2importdata.cpp b/src/autodetect/evolutionv2/evolutionv2importdata.cpp
index 6b7c055..b5a9158 100644
--- a/src/autodetect/evolutionv2/evolutionv2importdata.cpp
+++ b/src/autodetect/evolutionv2/evolutionv2importdata.cpp
@@ -23,10 +23,11 @@
#include "importfilterinfogui.h"
#include <KLocalizedString>
+#include <kpluginfactory.h>
#include <QDir>
-Evolutionv2ImportData::Evolutionv2ImportData(ImportWizard *parent)
+Evolutionv2ImportData::Evolutionv2ImportData(QObject *parent, const QList<QVariant> &)
: AbstractImporter(parent)
{
mPath = MailImporter::FilterEvolution_v2::defaultSettingsPath();
diff --git a/src/autodetect/evolutionv2/evolutionv2importdata.h b/src/autodetect/evolutionv2/evolutionv2importdata.h
index 0ef1192..8057540 100644
--- a/src/autodetect/evolutionv2/evolutionv2importdata.h
+++ b/src/autodetect/evolutionv2/evolutionv2importdata.h
@@ -25,7 +25,7 @@ class ImportWizard;
class Evolutionv2ImportData : public AbstractImporter
{
public:
- explicit Evolutionv2ImportData(ImportWizard *parent);
+ explicit Evolutionv2ImportData(QObject *parent, const QList<QVariant> & = QList<QVariant>());
~Evolutionv2ImportData();
TypeSupportedOptions supportedOption() Q_DECL_OVERRIDE;
diff --git a/src/autodetect/evolutionv3/evolutionv3importdata.cpp b/src/autodetect/evolutionv3/evolutionv3importdata.cpp
index 9970d12..61e4e87 100644
--- a/src/autodetect/evolutionv3/evolutionv3importdata.cpp
+++ b/src/autodetect/evolutionv3/evolutionv3importdata.cpp
@@ -32,7 +32,7 @@
#include <QDir>
-Evolutionv3ImportData::Evolutionv3ImportData(ImportWizard *parent)
+Evolutionv3ImportData::Evolutionv3ImportData(QObject *parent, const QList<QVariant> &)
: AbstractImporter(parent)
{
mPath = MailImporter::FilterEvolution_v3::defaultSettingsPath();
diff --git a/src/autodetect/evolutionv3/evolutionv3importdata.h b/src/autodetect/evolutionv3/evolutionv3importdata.h
index ec1578b..36cec8c 100644
--- a/src/autodetect/evolutionv3/evolutionv3importdata.h
+++ b/src/autodetect/evolutionv3/evolutionv3importdata.h
@@ -25,7 +25,7 @@ class ImportWizard;
class Evolutionv3ImportData : public AbstractImporter
{
public:
- explicit Evolutionv3ImportData(ImportWizard *parent);
+ explicit Evolutionv3ImportData(QObject *parent, const QList<QVariant> & = QList<QVariant>());
~Evolutionv3ImportData();
TypeSupportedOptions supportedOption() Q_DECL_OVERRIDE;
diff --git a/src/autodetect/geary/gearyimportdata.cpp b/src/autodetect/geary/gearyimportdata.cpp
index f506d4a..8e97e0e 100644
--- a/src/autodetect/geary/gearyimportdata.cpp
+++ b/src/autodetect/geary/gearyimportdata.cpp
@@ -25,10 +25,12 @@
#include "importfilterinfogui.h"
#include "importwizard.h"
#include "importwizard_debug.h"
-
+#include <kpluginfactory.h>
#include <QDir>
-GearyImportData::GearyImportData(ImportWizard *parent)
+K_PLUGIN_FACTORY_WITH_JSON(GearyImporterFactory, "gearyimporter.json", registerPlugin<GearyImportData>();)
+
+GearyImportData::GearyImportData(QObject *parent, const QList<QVariant> &)
: AbstractImporter(parent)
{
mPath = MailImporter::OtherMailerUtil::gearyDefaultPath();
@@ -86,3 +88,5 @@ AbstractImporter::TypeSupportedOptions GearyImportData::supportedOption()
//options |= AbstractImporter::AddressBooks;
return options;
}
+
+#include "gearyimportdata.moc"
diff --git a/src/autodetect/geary/gearyimportdata.h b/src/autodetect/geary/gearyimportdata.h
index 3fe9421..20ed5af 100644
--- a/src/autodetect/geary/gearyimportdata.h
+++ b/src/autodetect/geary/gearyimportdata.h
@@ -25,7 +25,7 @@ class ImportWizard;
class GearyImportData : public AbstractImporter
{
public:
- explicit GearyImportData(ImportWizard *parent);
+ explicit GearyImportData(QObject *parent, const QList<QVariant> & = QList<QVariant>());
~GearyImportData();
TypeSupportedOptions supportedOption() Q_DECL_OVERRIDE;
diff --git a/src/autodetect/geary/gearyimporter.json b/src/autodetect/geary/gearyimporter.json
new file mode 100644
index 0000000..4e86cb2
--- /dev/null
+++ b/src/autodetect/geary/gearyimporter.json
@@ -0,0 +1,10 @@
+{
+ "KPlugin": {
+ "Id": "gearyimporter",
+ "Name": "Geary Importer",
+ "ServiceTypes": [
+ "ImportWizard/PluginMailImporter"
+ ],
+ "Version": "1.0"
+ }
+}
diff --git a/src/autodetect/icedove/icedoveimportdata.cpp b/src/autodetect/icedove/icedoveimportdata.cpp
index cc1fd92..0e72f8d 100644
--- a/src/autodetect/icedove/icedoveimportdata.cpp
+++ b/src/autodetect/icedove/icedoveimportdata.cpp
@@ -28,11 +28,12 @@
#include "importwizard.h"
#include <KLocalizedString>
+#include <kpluginfactory.h>
#include <KConfig>
#include <QDir>
-IcedoveImportData::IcedoveImportData(ImportWizard *parent)
+IcedoveImportData::IcedoveImportData(QObject *parent, const QList<QVariant> &)
: AbstractImporter(parent)
{
mPath = MailImporter::FilterIcedove::defaultSettingsPath();
diff --git a/src/autodetect/icedove/icedoveimportdata.h b/src/autodetect/icedove/icedoveimportdata.h
index 526590f..d918665 100644
--- a/src/autodetect/icedove/icedoveimportdata.h
+++ b/src/autodetect/icedove/icedoveimportdata.h
@@ -25,7 +25,7 @@ class ImportWizard;
class IcedoveImportData : public AbstractImporter
{
public:
- explicit IcedoveImportData(ImportWizard *parent);
+ explicit IcedoveImportData(QObject *parent, const QList<QVariant> & = QList<QVariant>());
~IcedoveImportData();
TypeSupportedOptions supportedOption() Q_DECL_OVERRIDE;
diff --git a/src/autodetect/mailapp/mailappimportdata.cpp b/src/autodetect/mailapp/mailappimportdata.cpp
index 7f738fe..980a6e1 100644
--- a/src/autodetect/mailapp/mailappimportdata.cpp
+++ b/src/autodetect/mailapp/mailappimportdata.cpp
@@ -24,10 +24,10 @@
#include "importwizard.h"
#include <KLocalizedString>
-
+#include <kpluginfactory.h>
#include <QDir>
-MailAppImportData::MailAppImportData(ImportWizard *parent)
+MailAppImportData::MailAppImportData(QObject *parent, const QList<QVariant> &)
: AbstractImporter(parent)
{
mPath = QDir::homePath();
diff --git a/src/autodetect/mailapp/mailappimportdata.h b/src/autodetect/mailapp/mailappimportdata.h
index 9e88389..f4c8146 100644
--- a/src/autodetect/mailapp/mailappimportdata.h
+++ b/src/autodetect/mailapp/mailappimportdata.h
@@ -25,7 +25,7 @@ class ImportWizard;
class MailAppImportData : public AbstractImporter
{
public:
- explicit MailAppImportData(ImportWizard *parent);
+ explicit MailAppImportData(QObject *parent, const QList<QVariant> & = QList<QVariant>());
~MailAppImportData();
TypeSupportedOptions supportedOption() Q_DECL_OVERRIDE;
diff --git a/src/autodetect/oe/oeimportdata.cpp b/src/autodetect/oe/oeimportdata.cpp
index a914723..bb62255 100644
--- a/src/autodetect/oe/oeimportdata.cpp
+++ b/src/autodetect/oe/oeimportdata.cpp
@@ -24,10 +24,11 @@
#include "importwizard.h"
#include <KLocalizedString>
+#include <kpluginfactory.h>
#include <QDir>
-OeImportData::OeImportData(ImportWizard *parent)
+OeImportData::OeImportData(QObject *parent, const QList<QVariant> &)
: AbstractImporter(parent)
{
mPath = QDir::homePath();
diff --git a/src/autodetect/oe/oeimportdata.h b/src/autodetect/oe/oeimportdata.h
index 5773928..73e0b16 100644
--- a/src/autodetect/oe/oeimportdata.h
+++ b/src/autodetect/oe/oeimportdata.h
@@ -25,7 +25,7 @@ class ImportWizard;
class OeImportData : public AbstractImporter
{
public:
- explicit OeImportData(ImportWizard *parent);
+ explicit OeImportData(QObject *parent, const QList<QVariant> & = QList<QVariant>());
~OeImportData();
TypeSupportedOptions supportedOption() Q_DECL_OVERRIDE;
diff --git a/src/autodetect/opera/operaimportdata.cpp b/src/autodetect/opera/operaimportdata.cpp
index e2a3977..3f8c529 100644
--- a/src/autodetect/opera/operaimportdata.cpp
+++ b/src/autodetect/opera/operaimportdata.cpp
@@ -26,10 +26,10 @@
#include "importwizard.h"
#include <KLocalizedString>
-
+#include <kpluginfactory.h>
#include <QDir>
-OperaImportData::OperaImportData(ImportWizard *parent)
+OperaImportData::OperaImportData(QObject *parent, const QList<QVariant> &)
: AbstractImporter(parent)
{
mPath = MailImporter::FilterOpera::defaultSettingsPath();
diff --git a/src/autodetect/opera/operaimportdata.h b/src/autodetect/opera/operaimportdata.h
index 091b7cb..39dc5fd 100644
--- a/src/autodetect/opera/operaimportdata.h
+++ b/src/autodetect/opera/operaimportdata.h
@@ -26,7 +26,7 @@ class ImportWizard;
class OperaImportData : public AbstractImporter
{
public:
- explicit OperaImportData(ImportWizard *parent);
+ explicit OperaImportData(QObject *parent, const QList<QVariant> & = QList<QVariant>());
~OperaImportData();
TypeSupportedOptions supportedOption() Q_DECL_OVERRIDE;
diff --git a/src/autodetect/pmail/pmailimportdata.cpp b/src/autodetect/pmail/pmailimportdata.cpp
index 6ac312b..65b0e6e 100644
--- a/src/autodetect/pmail/pmailimportdata.cpp
+++ b/src/autodetect/pmail/pmailimportdata.cpp
@@ -25,10 +25,10 @@
#include "importwizard.h"
#include <KLocalizedString>
-
+#include <kpluginfactory.h>
#include <QDir>
-PMailImportData::PMailImportData(ImportWizard *parent)
+PMailImportData::PMailImportData(QObject *parent, const QList<QVariant> &)
: AbstractImporter(parent)
{
mPath = QDir::homePath();
diff --git a/src/autodetect/pmail/pmailimportdata.h b/src/autodetect/pmail/pmailimportdata.h
index c0f2ed5..a540539 100644
--- a/src/autodetect/pmail/pmailimportdata.h
+++ b/src/autodetect/pmail/pmailimportdata.h
@@ -26,7 +26,7 @@ class ImportWizard;
class PMailImportData : public AbstractImporter
{
public:
- explicit PMailImportData(ImportWizard *parent);
+ explicit PMailImportData(QObject *parent, const QList<QVariant> & = QList<QVariant>());
~PMailImportData();
TypeSupportedOptions supportedOption() Q_DECL_OVERRIDE;
diff --git a/src/autodetect/sylpheed/sylpheedimportdata.cpp b/src/autodetect/sylpheed/sylpheedimportdata.cpp
index e1c3660..bac927d 100644
--- a/src/autodetect/sylpheed/sylpheedimportdata.cpp
+++ b/src/autodetect/sylpheed/sylpheedimportdata.cpp
@@ -27,10 +27,10 @@
#include "sylpheed/sylpheedaddressbook.h"
#include <KLocalizedString>
-
+#include <kpluginfactory.h>
#include <QDir>
-SylpheedImportData::SylpheedImportData(ImportWizard *parent)
+SylpheedImportData::SylpheedImportData(QObject *parent, const QList<QVariant> &)
: AbstractImporter(parent)
{
mPath = MailImporter::FilterSylpheed::defaultSettingsPath();
diff --git a/src/autodetect/sylpheed/sylpheedimportdata.h b/src/autodetect/sylpheed/sylpheedimportdata.h
index 3e2a2d8..686af88 100644
--- a/src/autodetect/sylpheed/sylpheedimportdata.h
+++ b/src/autodetect/sylpheed/sylpheedimportdata.h
@@ -25,7 +25,7 @@ class ImportWizard;
class SylpheedImportData : public AbstractImporter
{
public:
- explicit SylpheedImportData(ImportWizard *parent);
+ explicit SylpheedImportData(QObject *parent, const QList<QVariant> & = QList<QVariant>());
~SylpheedImportData();
TypeSupportedOptions supportedOption() Q_DECL_OVERRIDE;
diff --git a/src/autodetect/thebat/thebatimportdata.cpp b/src/autodetect/thebat/thebatimportdata.cpp
index b889521..8ea85a3 100644
--- a/src/autodetect/thebat/thebatimportdata.cpp
+++ b/src/autodetect/thebat/thebatimportdata.cpp
@@ -24,10 +24,11 @@
#include "importwizard.h"
#include <KLocalizedString>
+#include <kpluginfactory.h>
#include <QDir>
-TheBatImportData::TheBatImportData(ImportWizard *parent)
+TheBatImportData::TheBatImportData(QObject *parent, const QList<QVariant> &)
: AbstractImporter(parent)
{
//TODO fix it
diff --git a/src/autodetect/thebat/thebatimportdata.h b/src/autodetect/thebat/thebatimportdata.h
index 618affd..2b69049 100644
--- a/src/autodetect/thebat/thebatimportdata.h
+++ b/src/autodetect/thebat/thebatimportdata.h
@@ -25,7 +25,7 @@ class ImportWizard;
class TheBatImportData : public AbstractImporter
{
public:
- explicit TheBatImportData(ImportWizard *parent);
+ explicit TheBatImportData(QObject *parent, const QList<QVariant> & = QList<QVariant>());
~TheBatImportData();
TypeSupportedOptions supportedOption() Q_DECL_OVERRIDE;
diff --git a/src/autodetect/thunderbird/thunderbirdimportdata.cpp b/src/autodetect/thunderbird/thunderbirdimportdata.cpp
index 3183bd5..299c072 100644
--- a/src/autodetect/thunderbird/thunderbirdimportdata.cpp
+++ b/src/autodetect/thunderbird/thunderbirdimportdata.cpp
@@ -28,10 +28,11 @@
#include "importwizard.h"
#include <KLocalizedString>
+#include <kpluginfactory.h>
#include <QDir>
-ThunderbirdImportData::ThunderbirdImportData(ImportWizard *parent)
+ThunderbirdImportData::ThunderbirdImportData(QObject *parent, const QList<QVariant> &)
: AbstractImporter(parent)
{
mPath = MailImporter::FilterThunderbird::defaultSettingsPath();
diff --git a/src/autodetect/thunderbird/thunderbirdimportdata.h b/src/autodetect/thunderbird/thunderbirdimportdata.h
index 9e91426..a4e8edf 100644
--- a/src/autodetect/thunderbird/thunderbirdimportdata.h
+++ b/src/autodetect/thunderbird/thunderbirdimportdata.h
@@ -25,7 +25,7 @@ class ImportWizard;
class ThunderbirdImportData : public AbstractImporter
{
public:
- explicit ThunderbirdImportData(ImportWizard *parent);
+ explicit ThunderbirdImportData(QObject *parent, const QList<QVariant> & = QList<QVariant>());
~ThunderbirdImportData();
TypeSupportedOptions supportedOption() Q_DECL_OVERRIDE;
diff --git a/src/autodetect/trojita/trojitaimportdata.cpp b/src/autodetect/trojita/trojitaimportdata.cpp
index de61601..038a708 100644
--- a/src/autodetect/trojita/trojitaimportdata.cpp
+++ b/src/autodetect/trojita/trojitaimportdata.cpp
@@ -24,10 +24,11 @@
#include "mailimporter/othermailerutil.h"
#include "importfilterinfogui.h"
#include "importwizard.h"
+#include <kpluginfactory.h>
#include <QDir>
-TrojitaImportData::TrojitaImportData(ImportWizard *parent)
+TrojitaImportData::TrojitaImportData(QObject *parent, const QList<QVariant> &)
: AbstractImporter(parent)
{
mPath = MailImporter::OtherMailerUtil::trojitaDefaultPath();
diff --git a/src/autodetect/trojita/trojitaimportdata.h b/src/autodetect/trojita/trojitaimportdata.h
index 9a7185c..c210423 100644
--- a/src/autodetect/trojita/trojitaimportdata.h
+++ b/src/autodetect/trojita/trojitaimportdata.h
@@ -25,7 +25,7 @@ class ImportWizard;
class TrojitaImportData : public AbstractImporter
{
public:
- explicit TrojitaImportData(ImportWizard *parent);
+ explicit TrojitaImportData(QObject *parent, const QList<QVariant> & = QList<QVariant>());
~TrojitaImportData();
TypeSupportedOptions supportedOption() Q_DECL_OVERRIDE;
diff --git a/src/importmailpluginmanager.cpp b/src/importmailpluginmanager.cpp
index 6cedfb1..71064f7 100644
--- a/src/importmailpluginmanager.cpp
+++ b/src/importmailpluginmanager.cpp
@@ -21,11 +21,14 @@
#include "importmailpluginmanager.h"
#include "importwizard_debug.h"
#include "abstractimporter.h"
-#include <QVector>
+
#include <KPluginMetaData>
#include <KPluginLoader>
#include <KPluginFactory>
+#include <QFileInfo>
+#include <QVector>
+
Q_GLOBAL_STATIC(ImportMailPluginManager, s_instance)
@@ -60,7 +63,6 @@ bool ImportMailPluginManager::initializePluginList()
return md.serviceTypes().contains(QStringLiteral("ImportWizard/PluginMailImporter"));
});
-#if 0
QVectorIterator<KPluginMetaData> i(plugins);
i.toBack();
QSet<QString> unique;
@@ -69,7 +71,7 @@ bool ImportMailPluginManager::initializePluginList()
const KPluginMetaData data = i.previous();
//1) get plugin data => name/description etc.
- info.pluginData = PimCommon::PluginUtil::createPluginMetaData(data);
+ info.pluginData = createPluginMetaData(data);
//2) look at if plugin is activated
info.metaDataFileNameBaseName = QFileInfo(data.fileName()).baseName();
info.metaDataFileName = data.fileName();
@@ -86,13 +88,10 @@ bool ImportMailPluginManager::initializePluginList()
}
}
QVector<ImportMailPluginManagerInfo>::iterator end(mPluginList.end());
- for (QVector<PluginEditorCheckBeforeSendInfo>::iterator it = mPluginList.begin(); it != end; ++it) {
+ for (QVector<ImportMailPluginManagerInfo>::iterator it = mPluginList.begin(); it != end; ++it) {
loadPlugin(&(*it));
}
return true;
- //TODO
-#endif
- return false;
}
void ImportMailPluginManager::loadPlugin(ImportMailPluginManagerInfo *item)
diff --git a/src/importwizard.cpp b/src/importwizard.cpp
index 0ab0807..808d461 100644
--- a/src/importwizard.cpp
+++ b/src/importwizard.cpp
@@ -106,7 +106,6 @@ ImportWizard::ImportWizard(WizardMode mode, QWidget *parent)
ImportWizard::~ImportWizard()
{
- qDeleteAll(mlistImport);
writeConfig();
}
@@ -219,28 +218,65 @@ void ImportWizard::createAutomaticModePage()
void ImportWizard::initializeImportModule()
{
//Import module
- addImportModule(new ThunderbirdImportData(this));
- addImportModule(new IcedoveImportData(this));
- addImportModule(new SylpheedImportData(this));
- addImportModule(new Evolutionv3ImportData(this));
- addImportModule(new Evolutionv2ImportData(this));
- addImportModule(new Evolutionv1ImportData(this));
- addImportModule(new OperaImportData(this));
+ AbstractImporter *importer = new ThunderbirdImportData(this);
+ importer->setImportWizard(this);
+ addImportModule(importer);
+
+ importer = new IcedoveImportData(this);
+ importer->setImportWizard(this);
+ addImportModule(importer);
+
+ importer = new SylpheedImportData(this);
+ importer->setImportWizard(this);
+ addImportModule(importer);
+
+ importer = new Evolutionv3ImportData(this);
+ importer->setImportWizard(this);
+ addImportModule(importer);
+
+ importer = new Evolutionv2ImportData(this);
+ importer->setImportWizard(this);
+ addImportModule(importer);
+
+ importer = new Evolutionv1ImportData(this);
+ importer->setImportWizard(this);
+ addImportModule(importer);
+
+ importer = new OperaImportData(this);
+ importer->setImportWizard(this);
+ addImportModule(importer);
#ifdef Q_OS_WIN
- addImportModule(new OeImportData(this));
+ importer = new OeImportData(this);
+ importer->setImportWizard(this);
+ addImportModule(importer);
#endif
#ifdef Q_OS_MAC
- addImportModule(new MailAppImportData(this));
+ importer = new OeImportData(this);
+ importer->setImportWizard(this);
+ addImportModule(importer);
#endif
#ifdef Q_OS_WIN
- addImportModule(new PMailImportData(this));
- addImportModule(new TheBatImportData(this));
+ importer = new PMailImportData(this);
+ importer->setImportWizard(this);
+ addImportModule(importer);
+
+ importer = new TheBatImportData(this);
+ importer->setImportWizard(this);
+ addImportModule(importer);
#endif
- addImportModule(new BalsaImportData(this));
- addImportModule(new ClawsMailImportData(this));
- addImportModule(new TrojitaImportData(this));
+ importer = new BalsaImportData(this);
+ importer->setImportWizard(this);
+ addImportModule(importer);
+
+ importer = new ClawsMailImportData(this);
+ importer->setImportWizard(this);
+ addImportModule(importer);
+
+ importer = new TrojitaImportData(this);
+ importer->setImportWizard(this);
+ addImportModule(importer);
}
void ImportWizard::slotProgramDoubleClicked()