Verified Commit 58f9d92a authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Port KAB import/export plugins to KPimAddressBookImportExport library

This is the "new" library that is installed by KAddressBook - contains
code moved in from the kf5kaddressbookimportexport library that was
in kdepim-apps-libs, as well as the contents of the 'shared' subdirectory
from here.
parent e3f61b01
Pipeline #34027 failed with stage
in 19 minutes and 36 seconds
...@@ -70,6 +70,7 @@ set(GRANTLEETHEME_LIB_VERSION "5.15.40") ...@@ -70,6 +70,7 @@ set(GRANTLEETHEME_LIB_VERSION "5.15.40")
set(CALENDARSUPPORT_LIB_VERSION "5.15.40") set(CALENDARSUPPORT_LIB_VERSION "5.15.40")
set(EVENTVIEW_LIB_VERSION "5.15.40") set(EVENTVIEW_LIB_VERSION "5.15.40")
set(LIBKDEPIM_LIB_VERSION "5.15.40") set(LIBKDEPIM_LIB_VERSION "5.15.40")
set(KADDRESSBOOK_IMPORTEXPORT_LIB_VERSION "5.15.40")
set(LIBKLEO_LIB_VERSION "5.15.40") set(LIBKLEO_LIB_VERSION "5.15.40")
set(AKONADI_LIB_VERSION "5.15.40") set(AKONADI_LIB_VERSION "5.15.40")
set(INCIDENCEEDITOR_LIB_VERSION "5.15.40") set(INCIDENCEEDITOR_LIB_VERSION "5.15.40")
...@@ -95,7 +96,7 @@ find_package(KF5WebEngineViewer ${MESSAGELIB_LIB_VERSION} CONFIG REQUIRED) ...@@ -95,7 +96,7 @@ find_package(KF5WebEngineViewer ${MESSAGELIB_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5TemplateParser ${MESSAGELIB_LIB_VERSION} CONFIG REQUIRED) find_package(KF5TemplateParser ${MESSAGELIB_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5MailCommon ${MAILCOMMON_LIB_VERSION} CONFIG REQUIRED) find_package(KF5MailCommon ${MAILCOMMON_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5MessageViewer ${MESSAGELIB_LIB_VERSION} CONFIG REQUIRED) find_package(KF5MessageViewer ${MESSAGELIB_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5KaddressbookImportExport ${KDEPIM_APPS_LIB_VERSION} CONFIG REQUIRED) find_package(KPimAddressbookImportExport ${KADDRESSBOOK_IMPORTEXPORT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Libkleo ${LIBKLEO_LIB_VERSION} CONFIG REQUIRED) find_package(KF5Libkleo ${LIBKLEO_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5GrantleeTheme ${GRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED) find_package(KF5GrantleeTheme ${GRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED) find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
......
add_definitions(-DTRANSLATION_DOMAIN=\"kaddressbook_importexportplugins\") add_definitions(-DTRANSLATION_DOMAIN=\"kaddressbook_importexportplugins\")
include_directories(${CMAKE_CURRENT_BINARY_DIR}/shared)
add_definitions(-DQGPGME_FOUND) add_definitions(-DQGPGME_FOUND)
add_subdirectory(shared)
add_subdirectory(vcards) add_subdirectory(vcards)
add_subdirectory(csv) add_subdirectory(csv)
add_subdirectory(gmx) add_subdirectory(gmx)
......
...@@ -12,7 +12,8 @@ set(kaddressbook_importexport_csv_SRCS ...@@ -12,7 +12,8 @@ set(kaddressbook_importexport_csv_SRCS
kcoreaddons_add_plugin(kaddressbook_importexportcsvplugin JSON kaddressbook_importexportcsvplugin.json SOURCES kcoreaddons_add_plugin(kaddressbook_importexportcsvplugin JSON kaddressbook_importexportcsvplugin.json SOURCES
${kaddressbook_importexport_csv_SRCS} INSTALL_NAMESPACE kaddressbook/importexportplugin) ${kaddressbook_importexport_csv_SRCS} INSTALL_NAMESPACE kaddressbook/importexportplugin)
target_link_libraries(kaddressbook_importexportcsvplugin KF5::KaddressbookImportExport target_link_libraries(kaddressbook_importexportcsvplugin
KPim::AddressbookImportExport
KF5::PimCommon KF5::PimCommon
KF5::I18n KF5::I18n
KF5::XmlGui KF5::XmlGui
...@@ -21,5 +22,4 @@ target_link_libraries(kaddressbook_importexportcsvplugin KF5::KaddressbookImport ...@@ -21,5 +22,4 @@ target_link_libraries(kaddressbook_importexportcsvplugin KF5::KaddressbookImport
KF5::Completion KF5::Completion
KF5::KIOWidgets KF5::KIOWidgets
KF5::AkonadiCore KF5::AkonadiCore
kaddressbookimportexportlibprivate
) )
...@@ -11,13 +11,11 @@ ...@@ -11,13 +11,11 @@
K_PLUGIN_CLASS_WITH_JSON(CSVImportExportPlugin, "kaddressbook_importexportcsvplugin.json") K_PLUGIN_CLASS_WITH_JSON(CSVImportExportPlugin, "kaddressbook_importexportcsvplugin.json")
CSVImportExportPlugin::CSVImportExportPlugin(QObject *parent, const QList<QVariant> &) CSVImportExportPlugin::CSVImportExportPlugin(QObject *parent, const QList<QVariant> &)
: KAddressBookImportExport::KAddressBookImportExportPlugin(parent) : KAddressBookImportExport::Plugin(parent)
{ {
} }
CSVImportExportPlugin::~CSVImportExportPlugin() CSVImportExportPlugin::~CSVImportExportPlugin() = default;
{
}
PimCommon::AbstractGenericPluginInterface *CSVImportExportPlugin::createInterface(QObject *parent) PimCommon::AbstractGenericPluginInterface *CSVImportExportPlugin::createInterface(QObject *parent)
{ {
......
...@@ -6,9 +6,11 @@ ...@@ -6,9 +6,11 @@
#ifndef CSVIMPORTEXPORTPLUGIN_H #ifndef CSVIMPORTEXPORTPLUGIN_H
#define CSVIMPORTEXPORTPLUGIN_H #define CSVIMPORTEXPORTPLUGIN_H
#include <KAddressBookImportExport/KAddressBookImportExportPlugin>
#include <KAddressBookImportExport/Plugin>
#include <QVariant> #include <QVariant>
class CSVImportExportPlugin : public KAddressBookImportExport::KAddressBookImportExportPlugin
class CSVImportExportPlugin : public KAddressBookImportExport::Plugin
{ {
Q_OBJECT Q_OBJECT
public: public:
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
*/ */
#include "csvimportexportplugininterface.h" #include "csvimportexportplugininterface.h"
#include "../shared/importexportengine.h"
#include "import/csvimportdialog.h" #include "import/csvimportdialog.h"
#include <KLocalizedString> #include <KLocalizedString>
#include <KActionCollection> #include <KActionCollection>
...@@ -19,17 +18,17 @@ ...@@ -19,17 +18,17 @@
#include <QFileDialog> #include <QFileDialog>
#include <QTextCodec> #include <QTextCodec>
#include <QPointer> #include <QPointer>
#include <KAddressBookContactSelectionDialog>
#include <KIO/Job> #include <KIO/Job>
#include <KAddressBookImportExport/ContactSelectionDialog>
#include <KAddressBookImportExport/ImportExportEngine>
CSVImportExportPluginInterface::CSVImportExportPluginInterface(QObject *parent) CSVImportExportPluginInterface::CSVImportExportPluginInterface(QObject *parent)
: KAddressBookImportExport::KAddressBookImportExportPluginInterface(parent) : KAddressBookImportExport::PluginInterface(parent)
{ {
} }
CSVImportExportPluginInterface::~CSVImportExportPluginInterface() CSVImportExportPluginInterface::~CSVImportExportPluginInterface() = default;
{
}
void CSVImportExportPluginInterface::createAction(KActionCollection *ac) void CSVImportExportPluginInterface::createAction(KActionCollection *ac)
{ {
...@@ -60,14 +59,14 @@ void CSVImportExportPluginInterface::exec() ...@@ -60,14 +59,14 @@ void CSVImportExportPluginInterface::exec()
void CSVImportExportPluginInterface::importCSV() void CSVImportExportPluginInterface::importCSV()
{ {
KAddressBookImportExport::KAddressBookImportExportContactList contactList; KAddressBookImportExport::ContactList contactList;
QPointer<CSVImportDialog> dlg = new CSVImportDialog(parentWidget()); QPointer<CSVImportDialog> dlg = new CSVImportDialog(parentWidget());
if (dlg->exec()) { if (dlg->exec()) {
contactList.setAddressList(dlg->contacts()); contactList.setAddressList(dlg->contacts());
} }
delete dlg; delete dlg;
ImportExportEngine *engine = new ImportExportEngine(this); auto *engine = new KAddressBookImportExport::ImportExportEngine(this);
engine->setContactList(contactList); engine->setContactList(contactList);
engine->setDefaultAddressBook(defaultCollection()); engine->setDefaultAddressBook(defaultCollection());
engine->importContacts(); engine->importContacts();
...@@ -90,8 +89,8 @@ void CSVImportExportPluginInterface::exportToFile(QFile *file, const KContacts:: ...@@ -90,8 +89,8 @@ void CSVImportExportPluginInterface::exportToFile(QFile *file, const KContacts::
QTextStream stream(file); QTextStream stream(file);
stream.setCodec(QTextCodec::codecForLocale()); stream.setCodec(QTextCodec::codecForLocale());
KAddressBookImportExport::KAddressBookImportExportContactFields::Fields fields = KAddressBookImportExport::KAddressBookImportExportContactFields::allFields(); auto fields = KAddressBookImportExport::ContactFields::allFields();
fields.remove(KAddressBookImportExport::KAddressBookImportExportContactFields::Undefined); fields.remove(KAddressBookImportExport::ContactFields::Undefined);
bool first = true; bool first = true;
...@@ -103,7 +102,7 @@ void CSVImportExportPluginInterface::exportToFile(QFile *file, const KContacts:: ...@@ -103,7 +102,7 @@ void CSVImportExportPluginInterface::exportToFile(QFile *file, const KContacts::
} }
// add quoting as defined in RFC 4180 // add quoting as defined in RFC 4180
QString label = KAddressBookImportExport::KAddressBookImportExportContactFields::label(fields.at(i)); QString label = KAddressBookImportExport::ContactFields::label(fields.at(i));
label.replace(QLatin1Char('"'), QStringLiteral("\"\"")); label.replace(QLatin1Char('"'), QStringLiteral("\"\""));
stream << "\"" << label << "\""; stream << "\"" << label << "\"";
...@@ -122,15 +121,15 @@ void CSVImportExportPluginInterface::exportToFile(QFile *file, const KContacts:: ...@@ -122,15 +121,15 @@ void CSVImportExportPluginInterface::exportToFile(QFile *file, const KContacts::
} }
QString content; QString content;
if (fields.at(j) == KAddressBookImportExport::KAddressBookImportExportContactFields::Birthday if (fields.at(j) == KAddressBookImportExport::ContactFields::Birthday
|| fields.at(j) == KAddressBookImportExport::KAddressBookImportExportContactFields::Anniversary) { || fields.at(j) == KAddressBookImportExport::ContactFields::Anniversary) {
const QDateTime dateTime const QDateTime dateTime
= QDateTime::fromString(KAddressBookImportExport::KAddressBookImportExportContactFields::value(fields.at(j), contact), Qt::ISODate); = QDateTime::fromString(KAddressBookImportExport::ContactFields::value(fields.at(j), contact), Qt::ISODate);
if (dateTime.isValid()) { if (dateTime.isValid()) {
content = dateTime.date().toString(Qt::ISODate); content = dateTime.date().toString(Qt::ISODate);
} }
} else { } else {
content = KAddressBookImportExport::KAddressBookImportExportContactFields::value(fields.at(j), contact).replace(QLatin1Char('\n'), QStringLiteral("\\n")); content = KAddressBookImportExport::ContactFields::value(fields.at(j), contact).replace(QLatin1Char('\n'), QStringLiteral("\\n"));
} }
// add quoting as defined in RFC 4180 // add quoting as defined in RFC 4180
...@@ -146,8 +145,8 @@ void CSVImportExportPluginInterface::exportToFile(QFile *file, const KContacts:: ...@@ -146,8 +145,8 @@ void CSVImportExportPluginInterface::exportToFile(QFile *file, const KContacts::
void CSVImportExportPluginInterface::exportCSV() void CSVImportExportPluginInterface::exportCSV()
{ {
QPointer<KAddressBookImportExport::KAddressBookContactSelectionDialog> dlg QPointer<KAddressBookImportExport::ContactSelectionDialog> dlg
= new KAddressBookImportExport::KAddressBookContactSelectionDialog(itemSelectionModel(), false, parentWidget()); = new KAddressBookImportExport::ContactSelectionDialog(itemSelectionModel(), false, parentWidget());
dlg->setMessageText(i18n("Which contact do you want to export?")); dlg->setMessageText(i18n("Which contact do you want to export?"));
dlg->setDefaultAddressBook(defaultCollection()); dlg->setDefaultAddressBook(defaultCollection());
if (!dlg->exec()) { if (!dlg->exec()) {
...@@ -162,7 +161,7 @@ void CSVImportExportPluginInterface::exportCSV() ...@@ -162,7 +161,7 @@ void CSVImportExportPluginInterface::exportCSV()
return; return;
} }
KAddressBookImportExport::KAddressBookImportExportContactList contactLists; KAddressBookImportExport::ContactList contactLists;
contactLists.setAddressList(contacts); contactLists.setAddressList(contacts);
QFileDialog::Options options = QFileDialog::DontConfirmOverwrite; QFileDialog::Options options = QFileDialog::DontConfirmOverwrite;
QUrl url = QFileDialog::getSaveFileUrl(parentWidget(), QString(), QUrl::fromLocalFile(QStringLiteral("addressbook.csv")), QString(), nullptr, options); QUrl url = QFileDialog::getSaveFileUrl(parentWidget(), QString(), QUrl::fromLocalFile(QStringLiteral("addressbook.csv")), QString(), nullptr, options);
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
#ifndef CSVIMPORTEXPORTPLUGININTERFACE_H #ifndef CSVIMPORTEXPORTPLUGININTERFACE_H
#define CSVIMPORTEXPORTPLUGININTERFACE_H #define CSVIMPORTEXPORTPLUGININTERFACE_H
#include <KAddressBookImportExport/KAddressBookImportExportPluginInterface> #include <KAddressBookImportExport/PluginInterface>
#include <KContacts/Addressee> #include <KContacts/Addressee>
class QFile; class QFile;
class CSVImportExportPluginInterface : public KAddressBookImportExport::KAddressBookImportExportPluginInterface class CSVImportExportPluginInterface : public KAddressBookImportExport::PluginInterface
{ {
Q_OBJECT Q_OBJECT
public: public:
......
...@@ -60,10 +60,10 @@ public: ...@@ -60,10 +60,10 @@ public:
{ {
fillFieldMap(); fillFieldMap();
addItem(KAddressBookImportExport::KAddressBookImportExportContactFields::label( addItem(KAddressBookImportExport::ContactFields::label(
KAddressBookImportExport::KAddressBookImportExportContactFields::Undefined), KAddressBookImportExport::KAddressBookImportExportContactFields::Undefined); KAddressBookImportExport::ContactFields::Undefined), KAddressBookImportExport::ContactFields::Undefined);
QMapIterator<QString, KAddressBookImportExport::KAddressBookImportExportContactFields::Field> it(mFieldMap); QMapIterator<QString, KAddressBookImportExport::ContactFields::Field> it(mFieldMap);
while (it.hasNext()) { while (it.hasNext()) {
it.next(); it.next();
...@@ -80,14 +80,14 @@ public: ...@@ -80,14 +80,14 @@ public:
setFixedSize(sizeHint()); setFixedSize(sizeHint());
} }
void setCurrentField(KAddressBookImportExport::KAddressBookImportExportContactFields::Field field) void setCurrentField(KAddressBookImportExport::ContactFields::Field field)
{ {
setCurrentIndex(findData((uint)field)); setCurrentIndex(findData((uint)field));
} }
KAddressBookImportExport::KAddressBookImportExportContactFields::Field currentField() const KAddressBookImportExport::ContactFields::Field currentField() const
{ {
return (KAddressBookImportExport::KAddressBookImportExportContactFields::Field)itemData(currentIndex()).toUInt(); return (KAddressBookImportExport::ContactFields::Field)itemData(currentIndex()).toUInt();
} }
private: private:
...@@ -97,18 +97,18 @@ private: ...@@ -97,18 +97,18 @@ private:
return; return;
} }
KAddressBookImportExport::KAddressBookImportExportContactFields::Fields fields = KAddressBookImportExport::KAddressBookImportExportContactFields::allFields(); KAddressBookImportExport::ContactFields::Fields fields = KAddressBookImportExport::ContactFields::allFields();
fields.remove(KAddressBookImportExport::KAddressBookImportExportContactFields::Undefined); fields.remove(KAddressBookImportExport::ContactFields::Undefined);
for (int i = 0, total = fields.count(); i < total; ++i) { for (int i = 0, total = fields.count(); i < total; ++i) {
mFieldMap.insert(KAddressBookImportExport::KAddressBookImportExportContactFields::label(fields.at(i)), fields.at(i)); mFieldMap.insert(KAddressBookImportExport::ContactFields::label(fields.at(i)), fields.at(i));
} }
} }
static QMap<QString, KAddressBookImportExport::KAddressBookImportExportContactFields::Field> mFieldMap; static QMap<QString, KAddressBookImportExport::ContactFields::Field> mFieldMap;
}; };
QMap<QString, KAddressBookImportExport::KAddressBookImportExportContactFields::Field> ContactFieldComboBox::mFieldMap; QMap<QString, KAddressBookImportExport::ContactFields::Field> ContactFieldComboBox::mFieldMap;
class ContactFieldDelegate : public QStyledItemDelegate class ContactFieldDelegate : public QStyledItemDelegate
{ {
...@@ -120,7 +120,7 @@ public: ...@@ -120,7 +120,7 @@ public:
QString displayText(const QVariant &value, const QLocale &) const override QString displayText(const QVariant &value, const QLocale &) const override
{ {
return KAddressBookImportExport::KAddressBookImportExportContactFields::label((KAddressBookImportExport::KAddressBookImportExportContactFields::Field)value.toUInt()); return KAddressBookImportExport::ContactFields::label((KAddressBookImportExport::ContactFields::Field)value.toUInt());
} }
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &) const override QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &) const override
...@@ -135,7 +135,7 @@ public: ...@@ -135,7 +135,7 @@ public:
const unsigned int value = index.model()->data(index, Qt::EditRole).toUInt(); const unsigned int value = index.model()->data(index, Qt::EditRole).toUInt();
ContactFieldComboBox *fieldCombo = static_cast<ContactFieldComboBox *>(editor); ContactFieldComboBox *fieldCombo = static_cast<ContactFieldComboBox *>(editor);
fieldCombo->setCurrentField((KAddressBookImportExport::KAddressBookImportExportContactFields::Field)value); fieldCombo->setCurrentField((KAddressBookImportExport::ContactFields::Field)value);
} }
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
...@@ -244,17 +244,17 @@ KContacts::AddresseeList CSVImportDialog::contacts() const ...@@ -244,17 +244,17 @@ KContacts::AddresseeList CSVImportDialog::contacts() const
if (!value.isEmpty()) { if (!value.isEmpty()) {
emptyRow = false; emptyRow = false;
const KAddressBookImportExport::KAddressBookImportExportContactFields::Field field const KAddressBookImportExport::ContactFields::Field field
= (KAddressBookImportExport::KAddressBookImportExportContactFields::Field)mModel->data(mModel->index(0, column)).toUInt(); = (KAddressBookImportExport::ContactFields::Field)mModel->data(mModel->index(0, column)).toUInt();
// convert the custom date format to ISO format // convert the custom date format to ISO format
if (field == KAddressBookImportExport::KAddressBookImportExportContactFields::Birthday || field == KAddressBookImportExport::KAddressBookImportExportContactFields::Anniversary) { if (field == KAddressBookImportExport::ContactFields::Birthday || field == KAddressBookImportExport::ContactFields::Anniversary) {
value = dateParser.parse(value).toString(Qt::ISODate); value = dateParser.parse(value).toString(Qt::ISODate);
} }
value.replace(QLatin1String("\\n"), QStringLiteral("\n")); value.replace(QLatin1String("\\n"), QStringLiteral("\n"));
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(field, value, contact); KAddressBookImportExport::ContactFields::setValue(field, value, contact);
} }
} }
...@@ -574,7 +574,7 @@ void CSVImportDialog::skipFirstRowChanged(bool checked, bool reload) ...@@ -574,7 +574,7 @@ void CSVImportDialog::skipFirstRowChanged(bool checked, bool reload)
mFieldSelection.clear(); mFieldSelection.clear();
for (int column = 0; column < mModel->columnCount(); ++column) { for (int column = 0; column < mModel->columnCount(); ++column) {
mFieldSelection.append( mFieldSelection.append(
(KAddressBookImportExport::KAddressBookImportExportContactFields::Field)mModel->data(mModel->index(0, column)).toInt()); (KAddressBookImportExport::ContactFields::Field)mModel->data(mModel->index(0, column)).toInt());
} }
if (checked) { if (checked) {
...@@ -604,7 +604,7 @@ void CSVImportDialog::slotOk() ...@@ -604,7 +604,7 @@ void CSVImportDialog::slotOk()
for (int column = 0; column < mModel->columnCount(); ++column) { for (int column = 0; column < mModel->columnCount(); ++column) {
if (mModel->data(mModel->index(0, column), if (mModel->data(mModel->index(0, column),
Qt::DisplayRole).toUInt() != KAddressBookImportExport::KAddressBookImportExportContactFields::Undefined) { Qt::DisplayRole).toUInt() != KAddressBookImportExport::ContactFields::Undefined) {
assigned = true; assigned = true;
break; break;
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#ifndef CSVIMPORTDIALOG_H #ifndef CSVIMPORTDIALOG_H
#define CSVIMPORTDIALOG_H #define CSVIMPORTDIALOG_H
#include <kaddressbookimportexport/kaddressbookimportexportcontactfields.h> #include <KAddressBookImportExport/ContactFields>
#include <QDialog> #include <QDialog>
...@@ -75,7 +75,7 @@ private: ...@@ -75,7 +75,7 @@ private:
QString mDelimiter; QString mDelimiter;
QMap<QString, uint> mTypeMap; QMap<QString, uint> mTypeMap;
QIODevice *mDevice = nullptr; QIODevice *mDevice = nullptr;
KAddressBookImportExport::KAddressBookImportExportContactFields::Fields mFieldSelection; KAddressBookImportExport::ContactFields::Fields mFieldSelection;
QPushButton *mUser1Button = nullptr; QPushButton *mUser1Button = nullptr;
QPushButton *mUser2Button = nullptr; QPushButton *mUser2Button = nullptr;
QPushButton *mOkButton = nullptr; QPushButton *mOkButton = nullptr;
......
...@@ -12,12 +12,12 @@ ecm_qt_declare_logging_category(kaddressbook_importexport_gmx_SRCS HEADER kaddre ...@@ -12,12 +12,12 @@ ecm_qt_declare_logging_category(kaddressbook_importexport_gmx_SRCS HEADER kaddre
kcoreaddons_add_plugin(kaddressbook_importexportgmxplugin JSON kaddressbook_importexportgmxplugin.json SOURCES kcoreaddons_add_plugin(kaddressbook_importexportgmxplugin JSON kaddressbook_importexportgmxplugin.json SOURCES
${kaddressbook_importexport_gmx_SRCS} INSTALL_NAMESPACE kaddressbook/importexportplugin) ${kaddressbook_importexport_gmx_SRCS} INSTALL_NAMESPACE kaddressbook/importexportplugin)
target_link_libraries(kaddressbook_importexportgmxplugin KF5::KaddressbookImportExport target_link_libraries(kaddressbook_importexportgmxplugin
KPim::AddressbookImportExport
KF5::PimCommon KF5::PimCommon
KF5::I18n KF5::I18n
KF5::XmlGui KF5::XmlGui
KF5::Contacts KF5::Contacts
KF5::JobWidgets KF5::JobWidgets
KF5::AkonadiCore KF5::AkonadiCore
kaddressbookimportexportlibprivate
) )
...@@ -11,13 +11,11 @@ ...@@ -11,13 +11,11 @@
K_PLUGIN_CLASS_WITH_JSON(GMXImportExportPlugin, "kaddressbook_importexportgmxplugin.json") K_PLUGIN_CLASS_WITH_JSON(GMXImportExportPlugin, "kaddressbook_importexportgmxplugin.json")
GMXImportExportPlugin::GMXImportExportPlugin(QObject *parent, const QList<QVariant> &) GMXImportExportPlugin::GMXImportExportPlugin(QObject *parent, const QList<QVariant> &)
: KAddressBookImportExport::KAddressBookImportExportPlugin(parent) : KAddressBookImportExport::Plugin(parent)
{ {
} }
GMXImportExportPlugin::~GMXImportExportPlugin() GMXImportExportPlugin::~GMXImportExportPlugin() = default;
{
}
PimCommon::AbstractGenericPluginInterface *GMXImportExportPlugin::createInterface(QObject *parent) PimCommon::AbstractGenericPluginInterface *GMXImportExportPlugin::createInterface(QObject *parent)
{ {
......
...@@ -6,15 +6,15 @@ ...@@ -6,15 +6,15 @@
#ifndef GMXIMPORTEXPORTPLUGIN_H #ifndef GMXIMPORTEXPORTPLUGIN_H
#define GMXIMPORTEXPORTPLUGIN_H #define GMXIMPORTEXPORTPLUGIN_H
#include <KAddressBookImportExport/KAddressBookImportExportPlugin>
#include <KAddressBookImportExport/Plugin>
#include <QVariant> #include <QVariant>
class GMXImportExportPlugin : public KAddressBookImportExport::KAddressBookImportExportPlugin
class GMXImportExportPlugin : public KAddressBookImportExport::Plugin
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit GMXImportExportPlugin(QObject *parent = nullptr, const QList<QVariant> & = explicit GMXImportExportPlugin(QObject *parent = nullptr, const QList<QVariant> & = {});
{
});
~GMXImportExportPlugin() override; ~GMXImportExportPlugin() override;
PimCommon::AbstractGenericPluginInterface *createInterface(QObject *parent) override; PimCommon::AbstractGenericPluginInterface *createInterface(QObject *parent) override;
......
...@@ -16,24 +16,23 @@ ...@@ -16,24 +16,23 @@
#include <QTemporaryFile> #include <QTemporaryFile>
#include <KJobWidgets> #include <KJobWidgets>
#include <QTextStream> #include <QTextStream>
#include <KAddressBookContactSelectionDialog>
#include <QPointer> #include <QPointer>
#include <importexportengine.h> #include <importexportengine.h>
#include <KIOCore/kio/filecopyjob.h> <