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

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")
set(CALENDARSUPPORT_LIB_VERSION "5.15.40")
set(EVENTVIEW_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(AKONADI_LIB_VERSION "5.15.40")
set(INCIDENCEEDITOR_LIB_VERSION "5.15.40")
......@@ -95,7 +96,7 @@ find_package(KF5WebEngineViewer ${MESSAGELIB_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5TemplateParser ${MESSAGELIB_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5MailCommon ${MAILCOMMON_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(KF5GrantleeTheme ${GRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
......
add_definitions(-DTRANSLATION_DOMAIN=\"kaddressbook_importexportplugins\")
include_directories(${CMAKE_CURRENT_BINARY_DIR}/shared)
add_definitions(-DQGPGME_FOUND)
add_subdirectory(shared)
add_subdirectory(vcards)
add_subdirectory(csv)
add_subdirectory(gmx)
......
......@@ -12,7 +12,8 @@ set(kaddressbook_importexport_csv_SRCS
kcoreaddons_add_plugin(kaddressbook_importexportcsvplugin JSON kaddressbook_importexportcsvplugin.json SOURCES
${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::I18n
KF5::XmlGui
......@@ -21,5 +22,4 @@ target_link_libraries(kaddressbook_importexportcsvplugin KF5::KaddressbookImport
KF5::Completion
KF5::KIOWidgets
KF5::AkonadiCore
kaddressbookimportexportlibprivate
)
......@@ -11,13 +11,11 @@
K_PLUGIN_CLASS_WITH_JSON(CSVImportExportPlugin, "kaddressbook_importexportcsvplugin.json")
CSVImportExportPlugin::CSVImportExportPlugin(QObject *parent, const QList<QVariant> &)
: KAddressBookImportExport::KAddressBookImportExportPlugin(parent)
: KAddressBookImportExport::Plugin(parent)
{
}
CSVImportExportPlugin::~CSVImportExportPlugin()
{
}
CSVImportExportPlugin::~CSVImportExportPlugin() = default;
PimCommon::AbstractGenericPluginInterface *CSVImportExportPlugin::createInterface(QObject *parent)
{
......
......@@ -6,9 +6,11 @@
#ifndef CSVIMPORTEXPORTPLUGIN_H
#define CSVIMPORTEXPORTPLUGIN_H
#include <KAddressBookImportExport/KAddressBookImportExportPlugin>
#include <KAddressBookImportExport/Plugin>
#include <QVariant>
class CSVImportExportPlugin : public KAddressBookImportExport::KAddressBookImportExportPlugin
class CSVImportExportPlugin : public KAddressBookImportExport::Plugin
{
Q_OBJECT
public:
......
......@@ -5,7 +5,6 @@
*/
#include "csvimportexportplugininterface.h"
#include "../shared/importexportengine.h"
#include "import/csvimportdialog.h"
#include <KLocalizedString>
#include <KActionCollection>
......@@ -19,17 +18,17 @@
#include <QFileDialog>
#include <QTextCodec>
#include <QPointer>
#include <KAddressBookContactSelectionDialog>
#include <KIO/Job>
#include <KAddressBookImportExport/ContactSelectionDialog>
#include <KAddressBookImportExport/ImportExportEngine>
CSVImportExportPluginInterface::CSVImportExportPluginInterface(QObject *parent)
: KAddressBookImportExport::KAddressBookImportExportPluginInterface(parent)
: KAddressBookImportExport::PluginInterface(parent)
{
}
CSVImportExportPluginInterface::~CSVImportExportPluginInterface()
{
}
CSVImportExportPluginInterface::~CSVImportExportPluginInterface() = default;
void CSVImportExportPluginInterface::createAction(KActionCollection *ac)
{
......@@ -60,14 +59,14 @@ void CSVImportExportPluginInterface::exec()
void CSVImportExportPluginInterface::importCSV()
{
KAddressBookImportExport::KAddressBookImportExportContactList contactList;
KAddressBookImportExport::ContactList contactList;
QPointer<CSVImportDialog> dlg = new CSVImportDialog(parentWidget());
if (dlg->exec()) {
contactList.setAddressList(dlg->contacts());
}
delete dlg;
ImportExportEngine *engine = new ImportExportEngine(this);
auto *engine = new KAddressBookImportExport::ImportExportEngine(this);
engine->setContactList(contactList);
engine->setDefaultAddressBook(defaultCollection());
engine->importContacts();
......@@ -90,8 +89,8 @@ void CSVImportExportPluginInterface::exportToFile(QFile *file, const KContacts::
QTextStream stream(file);
stream.setCodec(QTextCodec::codecForLocale());
KAddressBookImportExport::KAddressBookImportExportContactFields::Fields fields = KAddressBookImportExport::KAddressBookImportExportContactFields::allFields();
fields.remove(KAddressBookImportExport::KAddressBookImportExportContactFields::Undefined);
auto fields = KAddressBookImportExport::ContactFields::allFields();
fields.remove(KAddressBookImportExport::ContactFields::Undefined);
bool first = true;
......@@ -103,7 +102,7 @@ void CSVImportExportPluginInterface::exportToFile(QFile *file, const KContacts::
}
// 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("\"\""));
stream << "\"" << label << "\"";
......@@ -122,15 +121,15 @@ void CSVImportExportPluginInterface::exportToFile(QFile *file, const KContacts::
}
QString content;
if (fields.at(j) == KAddressBookImportExport::KAddressBookImportExportContactFields::Birthday
|| fields.at(j) == KAddressBookImportExport::KAddressBookImportExportContactFields::Anniversary) {
if (fields.at(j) == KAddressBookImportExport::ContactFields::Birthday
|| fields.at(j) == KAddressBookImportExport::ContactFields::Anniversary) {
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()) {
content = dateTime.date().toString(Qt::ISODate);
}
} 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
......@@ -146,8 +145,8 @@ void CSVImportExportPluginInterface::exportToFile(QFile *file, const KContacts::
void CSVImportExportPluginInterface::exportCSV()
{
QPointer<KAddressBookImportExport::KAddressBookContactSelectionDialog> dlg
= new KAddressBookImportExport::KAddressBookContactSelectionDialog(itemSelectionModel(), false, parentWidget());
QPointer<KAddressBookImportExport::ContactSelectionDialog> dlg
= new KAddressBookImportExport::ContactSelectionDialog(itemSelectionModel(), false, parentWidget());
dlg->setMessageText(i18n("Which contact do you want to export?"));
dlg->setDefaultAddressBook(defaultCollection());
if (!dlg->exec()) {
......@@ -162,7 +161,7 @@ void CSVImportExportPluginInterface::exportCSV()
return;
}
KAddressBookImportExport::KAddressBookImportExportContactList contactLists;
KAddressBookImportExport::ContactList contactLists;
contactLists.setAddressList(contacts);
QFileDialog::Options options = QFileDialog::DontConfirmOverwrite;
QUrl url = QFileDialog::getSaveFileUrl(parentWidget(), QString(), QUrl::fromLocalFile(QStringLiteral("addressbook.csv")), QString(), nullptr, options);
......
......@@ -7,10 +7,10 @@
#ifndef CSVIMPORTEXPORTPLUGININTERFACE_H
#define CSVIMPORTEXPORTPLUGININTERFACE_H
#include <KAddressBookImportExport/KAddressBookImportExportPluginInterface>
#include <KAddressBookImportExport/PluginInterface>
#include <KContacts/Addressee>
class QFile;
class CSVImportExportPluginInterface : public KAddressBookImportExport::KAddressBookImportExportPluginInterface
class CSVImportExportPluginInterface : public KAddressBookImportExport::PluginInterface
{
Q_OBJECT
public:
......
......@@ -60,10 +60,10 @@ public:
{
fillFieldMap();
addItem(KAddressBookImportExport::KAddressBookImportExportContactFields::label(
KAddressBookImportExport::KAddressBookImportExportContactFields::Undefined), KAddressBookImportExport::KAddressBookImportExportContactFields::Undefined);
addItem(KAddressBookImportExport::ContactFields::label(
KAddressBookImportExport::ContactFields::Undefined), KAddressBookImportExport::ContactFields::Undefined);
QMapIterator<QString, KAddressBookImportExport::KAddressBookImportExportContactFields::Field> it(mFieldMap);
QMapIterator<QString, KAddressBookImportExport::ContactFields::Field> it(mFieldMap);
while (it.hasNext()) {
it.next();
......@@ -80,14 +80,14 @@ public:
setFixedSize(sizeHint());
}
void setCurrentField(KAddressBookImportExport::KAddressBookImportExportContactFields::Field field)
void setCurrentField(KAddressBookImportExport::ContactFields::Field 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:
......@@ -97,18 +97,18 @@ private:
return;
}
KAddressBookImportExport::KAddressBookImportExportContactFields::Fields fields = KAddressBookImportExport::KAddressBookImportExportContactFields::allFields();
fields.remove(KAddressBookImportExport::KAddressBookImportExportContactFields::Undefined);
KAddressBookImportExport::ContactFields::Fields fields = KAddressBookImportExport::ContactFields::allFields();
fields.remove(KAddressBookImportExport::ContactFields::Undefined);
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
{
......@@ -120,7 +120,7 @@ public:
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
......@@ -135,7 +135,7 @@ public:
const unsigned int value = index.model()->data(index, Qt::EditRole).toUInt();
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
......@@ -244,17 +244,17 @@ KContacts::AddresseeList CSVImportDialog::contacts() const
if (!value.isEmpty()) {
emptyRow = false;
const KAddressBookImportExport::KAddressBookImportExportContactFields::Field field
= (KAddressBookImportExport::KAddressBookImportExportContactFields::Field)mModel->data(mModel->index(0, column)).toUInt();
const KAddressBookImportExport::ContactFields::Field field
= (KAddressBookImportExport::ContactFields::Field)mModel->data(mModel->index(0, column)).toUInt();
// 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.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)
mFieldSelection.clear();
for (int column = 0; column < mModel->columnCount(); ++column) {
mFieldSelection.append(
(KAddressBookImportExport::KAddressBookImportExportContactFields::Field)mModel->data(mModel->index(0, column)).toInt());
(KAddressBookImportExport::ContactFields::Field)mModel->data(mModel->index(0, column)).toInt());
}
if (checked) {
......@@ -604,7 +604,7 @@ void CSVImportDialog::slotOk()
for (int column = 0; column < mModel->columnCount(); ++column) {
if (mModel->data(mModel->index(0, column),
Qt::DisplayRole).toUInt() != KAddressBookImportExport::KAddressBookImportExportContactFields::Undefined) {
Qt::DisplayRole).toUInt() != KAddressBookImportExport::ContactFields::Undefined) {
assigned = true;
break;
}
......
......@@ -8,7 +8,7 @@
#ifndef CSVIMPORTDIALOG_H
#define CSVIMPORTDIALOG_H
#include <kaddressbookimportexport/kaddressbookimportexportcontactfields.h>
#include <KAddressBookImportExport/ContactFields>
#include <QDialog>
......@@ -75,7 +75,7 @@ private:
QString mDelimiter;
QMap<QString, uint> mTypeMap;
QIODevice *mDevice = nullptr;
KAddressBookImportExport::KAddressBookImportExportContactFields::Fields mFieldSelection;
KAddressBookImportExport::ContactFields::Fields mFieldSelection;
QPushButton *mUser1Button = nullptr;
QPushButton *mUser2Button = nullptr;
QPushButton *mOkButton = nullptr;
......
......@@ -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
${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::I18n
KF5::XmlGui
KF5::Contacts
KF5::JobWidgets
KF5::AkonadiCore
kaddressbookimportexportlibprivate
)
......@@ -11,13 +11,11 @@
K_PLUGIN_CLASS_WITH_JSON(GMXImportExportPlugin, "kaddressbook_importexportgmxplugin.json")
GMXImportExportPlugin::GMXImportExportPlugin(QObject *parent, const QList<QVariant> &)
: KAddressBookImportExport::KAddressBookImportExportPlugin(parent)
: KAddressBookImportExport::Plugin(parent)
{
}
GMXImportExportPlugin::~GMXImportExportPlugin()
{
}
GMXImportExportPlugin::~GMXImportExportPlugin() = default;
PimCommon::AbstractGenericPluginInterface *GMXImportExportPlugin::createInterface(QObject *parent)
{
......
......@@ -6,15 +6,15 @@
#ifndef GMXIMPORTEXPORTPLUGIN_H
#define GMXIMPORTEXPORTPLUGIN_H
#include <KAddressBookImportExport/KAddressBookImportExportPlugin>
#include <KAddressBookImportExport/Plugin>
#include <QVariant>
class GMXImportExportPlugin : public KAddressBookImportExport::KAddressBookImportExportPlugin
class GMXImportExportPlugin : public KAddressBookImportExport::Plugin
{
Q_OBJECT
public:
explicit GMXImportExportPlugin(QObject *parent = nullptr, const QList<QVariant> & =
{
});
explicit GMXImportExportPlugin(QObject *parent = nullptr, const QList<QVariant> & = {});
~GMXImportExportPlugin() override;
PimCommon::AbstractGenericPluginInterface *createInterface(QObject *parent) override;
......
......@@ -16,24 +16,23 @@
#include <QTemporaryFile>
#include <KJobWidgets>
#include <QTextStream>
#include <KAddressBookContactSelectionDialog>
#include <QPointer>
#include <importexportengine.h>
#include <KIOCore/kio/filecopyjob.h>
#include <KAddressBookImportExport/ContactSelectionDialog>
#define GMX_FILESELECTION_STRING i18n("GMX address book file (*.gmxa)")
const int typeHome = 0;
const int typeWork = 1;
const int typeOther = 2;
GMXImportExportPluginInterface::GMXImportExportPluginInterface(QObject *parent)
: KAddressBookImportExport::KAddressBookImportExportPluginInterface(parent)
: KAddressBookImportExport::PluginInterface(parent)
{
}
GMXImportExportPluginInterface::~GMXImportExportPluginInterface()
{
}
GMXImportExportPluginInterface::~GMXImportExportPluginInterface() = default;
void GMXImportExportPluginInterface::createAction(KActionCollection *ac)
{
......@@ -76,8 +75,8 @@ void GMXImportExportPluginInterface::slotExportGmx()
void GMXImportExportPluginInterface::exportGMX()
{
QPointer<KAddressBookImportExport::KAddressBookContactSelectionDialog> dlg
= new KAddressBookImportExport::KAddressBookContactSelectionDialog(itemSelectionModel(), false, parentWidget());
QPointer<KAddressBookImportExport::ContactSelectionDialog> dlg
= new KAddressBookImportExport::ContactSelectionDialog(itemSelectionModel(), false, parentWidget());
dlg->setMessageText(i18n("Which contact do you want to export?"));
dlg->setDefaultAddressBook(defaultCollection());
if (!dlg->exec()) {
......@@ -92,7 +91,7 @@ void GMXImportExportPluginInterface::exportGMX()
return;
}
KAddressBookImportExport::KAddressBookImportExportContactList contactLists;
KAddressBookImportExport::ContactList contactLists;
contactLists.setAddressList(contacts);
QFileDialog::Options options = QFileDialog::DontConfirmOverwrite;
QUrl url = QFileDialog::getSaveFileUrl(parentWidget(), QString(), QUrl::fromLocalFile(QDir::homePath() + QStringLiteral("/addressbook.gmx")), GMX_FILESELECTION_STRING, nullptr, options);
......@@ -659,10 +658,10 @@ void GMXImportExportPluginInterface::importGMX()
}
file.close();
KAddressBookImportExport::KAddressBookImportExportContactList contactList;
KAddressBookImportExport::ContactList contactList;
contactList.setAddressList(addresseeList);
ImportExportEngine *engine = new ImportExportEngine(this);
auto *engine = new KAddressBookImportExport::ImportExportEngine(this);
engine->setContactList(contactList);
engine->setDefaultAddressBook(defaultCollection());
engine->importContacts();
......
......@@ -7,11 +7,11 @@
#ifndef GMXIMPORTEXPORTPLUGININTERFACE_H
#define GMXIMPORTEXPORTPLUGININTERFACE_H
#include <KAddressBookImportExport/KAddressBookImportExportPluginInterface>
#include <KAddressBookImportExport/PluginInterface>
#include <QFile>
#include <KContacts/Addressee>
class GMXImportExportPluginInterface : public KAddressBookImportExport::KAddressBookImportExportPluginInterface
class GMXImportExportPluginInterface : public KAddressBookImportExport::PluginInterface
{
Q_OBJECT
public:
......
......@@ -7,11 +7,11 @@ set(kaddressbook_importexport_ldap_SRCS
kcoreaddons_add_plugin(kaddressbook_importexportldapplugin JSON kaddressbook_importexportldapplugin.json SOURCES
${kaddressbook_importexport_ldap_SRCS} INSTALL_NAMESPACE kaddressbook/importexportplugin)
target_link_libraries(kaddressbook_importexportldapplugin KF5::KaddressbookImportExport
target_link_libraries(kaddressbook_importexportldapplugin
KPim::AddressbookImportExport
KF5::AkonadiCore
KF5::I18n
KF5::XmlGui
KF5::Contacts
kaddressbookimportexportlibprivate
KF5::PimCommonAkonadi
)
......@@ -11,13 +11,11 @@
K_PLUGIN_CLASS_WITH_JSON(LDapImportExportPlugin, "kaddressbook_importexportldapplugin.json")
LDapImportExportPlugin::LDapImportExportPlugin(QObject *parent, const QList<QVariant> &)
: KAddressBookImportExport::KAddressBookImportExportPlugin(parent)
: KAddressBookImportExport::Plugin(parent)
{
}
LDapImportExportPlugin::~LDapImportExportPlugin()
{
}
LDapImportExportPlugin::~LDapImportExportPlugin() = default;
PimCommon::AbstractGenericPluginInterface *LDapImportExportPlugin::createInterface(QObject *parent)
{
......
......@@ -6,15 +6,15 @@
#ifndef LDAPIMPORTEXPORTPLUGIN_H
#define LDAPIMPORTEXPORTPLUGIN_H
#include <KAddressBookImportExport/KAddressBookImportExportPlugin>
#include <KAddressBookImportExport/Plugin>
#include <QVariant>
class LDapImportExportPlugin : public KAddressBookImportExport::KAddressBookImportExportPlugin
class LDapImportExportPlugin : public KAddressBookImportExport::Plugin
{
Q_OBJECT
public:
explicit LDapImportExportPlugin(QObject *parent = nullptr, const QList<QVariant> & =
{
});
explicit LDapImportExportPlugin(QObject *parent = nullptr, const QList<QVariant> & = {});
~LDapImportExportPlugin() override;
PimCommon::AbstractGenericPluginInterface *createInterface(QObject *parent) override;
......
......@@ -10,16 +10,14 @@
#include <QAction>
#include <QPointer>
#include <PimCommonAkonadi/LdapSearchDialog>
#include "../shared/importexportengine.h"
#include <KAddressBookImportExport/ImportExportEngine>
LDapImportExportPluginInterface::LDapImportExportPluginInterface(QObject *parent)
: KAddressBookImportExport::KAddressBookImportExportPluginInterface(parent)
: KAddressBookImportExport::PluginInterface(parent)
{
}
LDapImportExportPluginInterface::~LDapImportExportPluginInterface()
{
}
LDapImportExportPluginInterface::~LDapImportExportPluginInterface() = default;
void LDapImportExportPluginInterface::createAction(KActionCollection *ac)
{
......@@ -49,7 +47,7 @@ void LDapImportExportPluginInterface::slotImportLdap()
void LDapImportExportPluginInterface::importLdap()
{
KAddressBookImportExport::KAddressBookImportExportContactList contactList;
KAddressBookImportExport::ContactList contactList;
QPointer<PimCommon::LdapSearchDialog> dlg = new PimCommon::LdapSearchDialog(parentWidget());
if (dlg->exec()) {
......@@ -57,7 +55,7 @@ void LDapImportExportPluginInterface::importLdap()
}
delete dlg;
ImportExportEngine *engine = new ImportExportEngine(this);
auto *engine = new KAddressBookImportExport::ImportExportEngine(this);
engine->setContactList(contactList);
engine->setDefaultAddressBook(defaultCollection());
engine->importContacts();
......
......@@ -7,8 +7,9 @@
#ifndef LDAPIMPORTEXPORTPLUGININTERFACE_H
#define LDAPIMPORTEXPORTPLUGININTERFACE_H
#include <KAddressBookImportExport/KAddressBookImportExportPluginInterface>
class LDapImportExportPluginInterface : public KAddressBookImportExport::KAddressBookImportExportPluginInterface
#include <KAddressBookImportExport/PluginInterface>
class LDapImportExportPluginInterface : public KAddressBookImportExport::PluginInterface
{
Q_OBJECT
public:
......
......@@ -7,12 +7,12 @@ set(kaddressbook_importexport_ldif_SRCS
kcoreaddons_add_plugin(kaddressbook_importexportldifplugin JSON kaddressbook_importexportldifplugin.json SOURCES
${kaddressbook_importexport_ldif_SRCS} INSTALL_NAMESPACE kaddressbook/importexportplugin)
target_link_libraries(kaddressbook_importexportldifplugin KF5::KaddressbookImportExport
target_link_libraries(kaddressbook_importexportldifplugin
KPim::AddressbookImportExport
KF5::PimCommon
KF5::I18n
KF5::XmlGui
KF5::Contacts
KF5::JobWidgets