Commit 18f08a0d authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Adapt to new KAccounts plugin system

Summary: KAccounts was ported from QPluginLoader to KPluginLoader in D27633. Adapt the KAccounts plugin to stay compatible

Reviewers: #kde_telepathy, bshah

Reviewed By: bshah

Subscribers: aacid

Differential Revision: https://phabricator.kde.org/D27657
parent abe3dbf9
project(kaccounts-integration-plugin)
include_directories (${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
)
set(kaccounts_ktp_plugin_SRCS
kaccounts-ktp-plugin.cpp
)
add_library(kaccounts_ktp_plugin MODULE ${kaccounts_ktp_plugin_SRCS})
kcoreaddons_add_plugin(kaccounts_ktp_plugin
JSON kaccountsplugin.json
SOURCES kaccounts-ktp-plugin.cpp
INSTALL_NAMESPACE kaccounts/daemonplugins)
target_link_libraries(kaccounts_ktp_plugin
Qt5::Core
......@@ -20,10 +13,3 @@ target_link_libraries(kaccounts_ktp_plugin
${ACCOUNTSQT_LIBRARIES}
${SIGNONQT_LIBRARIES}
)
# Install:
install (TARGETS kaccounts_ktp_plugin
DESTINATION ${PLUGIN_INSTALL_DIR}/kaccounts/daemonplugins
)
......@@ -32,6 +32,7 @@
#include <KSharedConfig>
#include <KConfigGroup>
#include <KPluginFactory>
#include <QTimer>
#include <QStandardPaths>
......@@ -60,6 +61,8 @@ static QStringList s_knownProviders{QStringLiteral("haze-icq"),
QStringLiteral("haze-yahoo"),
QStringLiteral("haze-gadugadu")};
K_PLUGIN_CLASS_WITH_JSON(KAccountsKTpPlugin, "kaccountsplugin.json")
class KAccountsKTpPlugin::Private {
public:
Private(KAccountsKTpPlugin *qq) { q = qq; migrationRef = 0; };
......@@ -324,8 +327,8 @@ void KAccountsKTpPlugin::Private::derefMigrationCount()
//---------------------------------------------------------------------------------------
KAccountsKTpPlugin::KAccountsKTpPlugin(QObject *parent)
: KAccountsDPlugin(parent),
KAccountsKTpPlugin::KAccountsKTpPlugin(QObject *parent, const QVariantList &args)
: KAccountsDPlugin(parent, args),
d(new Private(this))
{
d->kaccountsConfig = KSharedConfig::openConfig(QStringLiteral("kaccounts-ktprc"));
......@@ -380,3 +383,5 @@ void KAccountsKTpPlugin::onServiceDisabled(const Accounts::AccountId accountId,
Q_UNUSED(accountId);
Q_UNUSED(service);
}
#include "kaccounts-ktp-plugin.moc"
......@@ -32,11 +32,8 @@ namespace Accounts {
class KAccountsKTpPlugin : public KAccountsDPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.kde.kaccounts.DPlugin")
Q_INTERFACES(KAccountsDPlugin)
public:
KAccountsKTpPlugin(QObject *parent = nullptr);
KAccountsKTpPlugin(QObject *parent, const QVariantList &args);
~KAccountsKTpPlugin() override;
public Q_SLOTS:
......
{
"KPlugin": {
"Description": "KTP KAccounts integration",
"EnabledByDefault": true,
"Icon": "telepathy-kde",
"Id": "kaccounts_ktp",
"License": "GPL",
"Name": "KTP",
"Version": "0.1"
}
}
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