Commit fd681e62 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Port deprecated KCMultiDialog methods & embed json metadata in KCM

This KCM will have to get installed installed in the new plasma namespace eventually.
But considering that this app is part of the release service, we should not
depend on changes in a not yet released Plasma version.

Task: https://phabricator.kde.org/T14501
parent 402ca000
......@@ -80,7 +80,7 @@ int main(int argc, char** argv)
QObject::connect(configure, &QAction::triggered, configure, [&dialog]() {
if (dialog == nullptr) {
dialog = new KCMultiDialog;
dialog->addModule(QStringLiteral("kcm_kdeconnect"));
dialog->addModule(KPluginMetaData(QStringLiteral("kcm_kdeconnect")));
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show();
} else {
......
add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-kcm")
set(kcm_SRCS
kcm.cpp
)
ki18n_wrap_ui(kcm_SRCS kcm.ui)
add_library(kcm_kdeconnect MODULE kcm.cpp)
add_library(kcm_kdeconnect MODULE ${kcm_SRCS})
ki18n_wrap_ui(kcm_kdeconnect kcm.ui)
kcoreaddons_desktop_to_json(kcm_kdeconnect "kcm_kdeconnect.desktop")
target_link_libraries(kcm_kdeconnect
Qt5::Core
......
......@@ -19,7 +19,7 @@
#include "devicessortproxymodel.h"
#include "kdeconnect-version.h"
K_PLUGIN_FACTORY(KdeConnectKcmFactory, registerPlugin<KdeConnectKcm>();)
K_PLUGIN_CLASS_WITH_JSON(KdeConnectKcm, "kcm_kdeconnect.json")
static QString createId() { return QStringLiteral("kcm")+QString::number(QCoreApplication::applicationPid()); }
......
......@@ -39,7 +39,7 @@ int main(int argc, char** argv)
KDBusService dbusService(KDBusService::Unique);
KCMultiDialog* dialog = new KCMultiDialog;
dialog->addModule(QStringLiteral("kcm_kdeconnect"), {parser.value(QStringLiteral("args"))});
dialog->addModule(KPluginMetaData(QStringLiteral("kcm_kdeconnect")), {parser.value(QStringLiteral("args"))});
auto style = dialog->style();
dialog->setContentsMargins(style->pixelMetric(QStyle::PM_LayoutLeftMargin),
......
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