Commit 0034e411 authored by Laurent Montel's avatar Laurent Montel 😁

Convert to plugin this one too

parent d64ba1b1
...@@ -48,9 +48,9 @@ set(libimportwizard_autodetect_SRCS ...@@ -48,9 +48,9 @@ set(libimportwizard_autodetect_SRCS
autodetect/evolutionv3/evolutionutil.cpp autodetect/evolutionv3/evolutionutil.cpp
autodetect/evolutionv2/evolutionv2importdata.cpp autodetect/evolutionv2/evolutionv2importdata.cpp
autodetect/evolutionv1/evolutionv1importdata.cpp autodetect/evolutionv1/evolutionv1importdata.cpp
autodetect/opera/operaimportdata.cpp # autodetect/opera/operaimportdata.cpp
autodetect/opera/operaaddressbook.cpp # autodetect/opera/operaaddressbook.cpp
autodetect/opera/operasettings.cpp # autodetect/opera/operasettings.cpp
autodetect/oe/oeimportdata.cpp autodetect/oe/oeimportdata.cpp
autodetect/mailapp/mailappimportdata.cpp autodetect/mailapp/mailappimportdata.cpp
autodetect/pmail/pmailimportdata.cpp autodetect/pmail/pmailimportdata.cpp
......
add_subdirectory(geary) add_subdirectory(geary)
add_subdirectory(trojita) add_subdirectory(trojita)
add_subdirectory(opera)
set(operaimporter_SRCS
operaaddressbook.cpp
operaimportdata.cpp
operasettings.cpp
)
kcoreaddons_add_plugin(operaimporterplugin JSON operaimporter.json SOURCES
${operaimporter_SRCS} INSTALL_NAMESPACE importwizard)
target_link_libraries(operaimporterplugin
libimportwizard
KF5::XmlGui
KF5::I18n
KF5::Contacts
KF5::MailImporterAkonadi
KF5::MailTransport
KF5::IdentityManagement
)
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <KContacts/Addressee> #include <KContacts/Addressee>
#include <QUrl> #include <QUrl>
#include "importwizard_debug.h" //#include "importwizard_debug.h"
#include <QFile> #include <QFile>
OperaAddressBook::OperaAddressBook(const QString &filename, ImportWizard *parent) OperaAddressBook::OperaAddressBook(const QString &filename, ImportWizard *parent)
...@@ -34,7 +34,7 @@ void OperaAddressBook::importAddressBook() ...@@ -34,7 +34,7 @@ void OperaAddressBook::importAddressBook()
{ {
QFile file(mFileName); QFile file(mFileName);
if (!file.open(QIODevice::ReadOnly)) { if (!file.open(QIODevice::ReadOnly)) {
qCDebug(IMPORTWIZARD_LOG) << " We can't open file" << mFileName; //FIXME qCDebug(IMPORTWIZARD_LOG) << " We can't open file" << mFileName;
return; return;
} }
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#include <kpluginfactory.h> #include <kpluginfactory.h>
#include <QDir> #include <QDir>
K_PLUGIN_FACTORY_WITH_JSON(OperaImporterFactory, "operaimporter.json", registerPlugin<OperaImportData>();)
OperaImportData::OperaImportData(QObject *parent, const QList<QVariant> &) OperaImportData::OperaImportData(QObject *parent, const QList<QVariant> &)
: AbstractImporter(parent) : AbstractImporter(parent)
{ {
...@@ -93,3 +95,5 @@ AbstractImporter::TypeSupportedOptions OperaImportData::supportedOption() ...@@ -93,3 +95,5 @@ AbstractImporter::TypeSupportedOptions OperaImportData::supportedOption()
options |= AbstractImporter::Settings; options |= AbstractImporter::Settings;
return options; return options;
} }
#include "operaimportdata.moc"
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
#include "operasettings.h" #include "operasettings.h"
#include "importwizard_debug.h" //#include "importwizard_debug.h"
#include "mailimporter/filteropera.h" #include "mailimporter/filteropera.h"
#include <mailtransport/transportmanager.h> #include <mailtransport/transportmanager.h>
...@@ -116,7 +116,7 @@ void OperaSettings::readAccount(const KConfigGroup &grp) ...@@ -116,7 +116,7 @@ void OperaSettings::readAccount(const KConfigGroup &grp)
} else if (leaveOnServer == 0) { } else if (leaveOnServer == 0) {
settings.insert(QStringLiteral("LeaveOnServer"), false); settings.insert(QStringLiteral("LeaveOnServer"), false);
} else { } else {
qCDebug(IMPORTWIZARD_LOG) << " leave on server option unknown : " << leaveOnServer; //FIXME qCDebug(IMPORTWIZARD_LOG) << " leave on server option unknown : " << leaveOnServer;
} }
const int removeMailFromSever = grp.readEntry(QStringLiteral("Remove From Server Delay Enabled"), -1); const int removeMailFromSever = grp.readEntry(QStringLiteral("Remove From Server Delay Enabled"), -1);
...@@ -164,7 +164,7 @@ void OperaSettings::readAccount(const KConfigGroup &grp) ...@@ -164,7 +164,7 @@ void OperaSettings::readAccount(const KConfigGroup &grp)
settings.insert(QStringLiteral("AuthenticationMethod"), MailTransport::Transport::EnumAuthenticationType::APOP); //TODO: verify settings.insert(QStringLiteral("AuthenticationMethod"), MailTransport::Transport::EnumAuthenticationType::APOP); //TODO: verify
break; break;
default: default:
qCDebug(IMPORTWIZARD_LOG) << " unknown authentication method :" << authMethod; //FIXME qCDebug(IMPORTWIZARD_LOG) << " unknown authentication method :" << authMethod;
break; break;
} }
...@@ -173,7 +173,7 @@ void OperaSettings::readAccount(const KConfigGroup &grp) ...@@ -173,7 +173,7 @@ void OperaSettings::readAccount(const KConfigGroup &grp)
addCheckMailOnStartup(agentIdentifyName, enableManualCheck); addCheckMailOnStartup(agentIdentifyName, enableManualCheck);
addToManualCheck(agentIdentifyName, enableManualCheck); addToManualCheck(agentIdentifyName, enableManualCheck);
} else { } else {
qCDebug(IMPORTWIZARD_LOG) << " protocol unknown : " << incomingProtocol; //FIXME qCDebug(IMPORTWIZARD_LOG) << " protocol unknown : " << incomingProtocol;
} }
} }
...@@ -219,7 +219,8 @@ void OperaSettings::readTransport(const KConfigGroup &grp) ...@@ -219,7 +219,8 @@ void OperaSettings::readTransport(const KConfigGroup &grp)
mt->setAuthenticationType(MailTransport::Transport::EnumAuthenticationType::PLAIN); //Don't know... Verify mt->setAuthenticationType(MailTransport::Transport::EnumAuthenticationType::PLAIN); //Don't know... Verify
break; break;
default: default:
qCDebug(IMPORTWIZARD_LOG) << " authMethod unknown :" << authMethod; //FIXME qCDebug(IMPORTWIZARD_LOG) << " authMethod unknown :" << authMethod;
;
} }
//We can't specify a default smtp... //We can't specify a default smtp...
...@@ -280,7 +281,7 @@ void OperaSettings::readIdentity(const KConfigGroup &grp) ...@@ -280,7 +281,7 @@ void OperaSettings::readIdentity(const KConfigGroup &grp)
signature.setText(QString(sigText)); signature.setText(QString(sigText));
break; break;
default: default:
qCDebug(IMPORTWIZARD_LOG) << " pb with Signature is HTML " << signatureHtml; //FIXME qCDebug(IMPORTWIZARD_LOG) << " pb with Signature is HTML " << signatureHtml;
break; break;
} }
newIdentity->setSignature(signature); newIdentity->setSignature(signature);
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include "autodetect/evolutionv2/evolutionv2importdata.h" #include "autodetect/evolutionv2/evolutionv2importdata.h"
#include "autodetect/evolutionv1/evolutionv1importdata.h" #include "autodetect/evolutionv1/evolutionv1importdata.h"
#include "autodetect/icedove/icedoveimportdata.h" #include "autodetect/icedove/icedoveimportdata.h"
#include "autodetect/opera/operaimportdata.h"
#include "autodetect/oe/oeimportdata.h" #include "autodetect/oe/oeimportdata.h"
#include "autodetect/mailapp/mailappimportdata.h" #include "autodetect/mailapp/mailappimportdata.h"
#include "autodetect/pmail/pmailimportdata.h" #include "autodetect/pmail/pmailimportdata.h"
...@@ -241,9 +240,9 @@ void ImportWizard::initializeImportModule() ...@@ -241,9 +240,9 @@ void ImportWizard::initializeImportModule()
importer->setImportWizard(this); importer->setImportWizard(this);
addImportModule(importer); addImportModule(importer);
importer = new OperaImportData(this); // importer = new OperaImportData(this);
importer->setImportWizard(this); // importer->setImportWizard(this);
addImportModule(importer); // addImportModule(importer);
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
importer = new OeImportData(this); importer = new OeImportData(this);
importer->setImportWizard(this); importer->setImportWizard(this);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment