diff --git a/kaccounts/CMakeLists.txt b/kaccounts/CMakeLists.txt --- a/kaccounts/CMakeLists.txt +++ b/kaccounts/CMakeLists.txt @@ -4,6 +4,7 @@ kaccounts_add_service(${CMAKE_CURRENT_SOURCE_DIR}/google-drive.service.in) kcoreaddons_add_plugin(kaccounts_gdrive + JSON kaccountsplugin.json SOURCES kaccountsplugin.cpp INSTALL_NAMESPACE kaccounts/daemonplugins) diff --git a/kaccounts/kaccountsplugin.h b/kaccounts/kaccountsplugin.h --- a/kaccounts/kaccountsplugin.h +++ b/kaccounts/kaccountsplugin.h @@ -24,11 +24,8 @@ class GoogleDrivePlugin : public KAccountsDPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.kde.kaccounts.DPlugin") - Q_INTERFACES(KAccountsDPlugin) - public: - explicit GoogleDrivePlugin(QObject *parent = nullptr); + explicit GoogleDrivePlugin(QObject *parent, const QVariantList &args); public slots: void onAccountCreated(const Accounts::AccountId accountId, const Accounts::ServiceList &serviceList) override; diff --git a/kaccounts/kaccountsplugin.cpp b/kaccounts/kaccountsplugin.cpp --- a/kaccounts/kaccountsplugin.cpp +++ b/kaccounts/kaccountsplugin.cpp @@ -25,8 +25,12 @@ #include #include -GoogleDrivePlugin::GoogleDrivePlugin(QObject *parent) - : KAccountsDPlugin(parent) +#include + +K_PLUGIN_CLASS_WITH_JSON(GoogleDrivePlugin, "kaccountsplugin.json") + +GoogleDrivePlugin::GoogleDrivePlugin(QObject *parent, const QVariantList &args) + : KAccountsDPlugin(parent, args) { } @@ -72,3 +76,5 @@ Q_UNUSED(accountId) Q_UNUSED(service) } + +#include "kaccountsplugin.moc" diff --git a/kaccounts/kaccountsplugin.json b/kaccounts/kaccountsplugin.json new file mode 100644 --- /dev/null +++ b/kaccounts/kaccountsplugin.json @@ -0,0 +1,12 @@ +{ + "KPlugin": { + "Description": "Integrate KIO gdrive", + "EnabledByDefault": true, + "Icon": "system-file-manager", + "Id": "kaccounts_kio_gdrive", + "License": "GPL", + "Name": "KIO gdrive", + "Version": "0.1" + } +} +