From 184120642a4953392d9e204495c7c1b97ade8f9a Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Thu, 12 May 2022 03:41:05 +0200 Subject: [PATCH] Fix using kdeconnect-settings when instance is already running kdeconnect-settings is a single-instance app When activating an existing instance actually load the requested settings part Bump KF5 dependency to 5.95 to include https://invent.kde.org/frameworks/kcmutils/-/merge_requests/90, otherwise there's a crash --- CMakeLists.txt | 2 +- settings/main.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5787d666d..9851d0faf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ if (SAILFISHOS) set(KF5_MIN_VERSION "5.36.0") set(QT_MIN_VERSION "5.6.0") else() - set(KF5_MIN_VERSION "5.89.0") + set(KF5_MIN_VERSION "5.95.0") set(QT_MIN_VERSION "5.10.0") set(KDE_COMPILERSETTINGS_LEVEL "5.84.0") endif() diff --git a/settings/main.cpp b/settings/main.cpp index 5429213da..d072eadd3 100644 --- a/settings/main.cpp +++ b/settings/main.cpp @@ -46,6 +46,16 @@ int main(int argc, char** argv) dialog->setAttribute(Qt::WA_DeleteOnClose); dialog->show(); + QObject::connect(&dbusService, &KDBusService::activateRequested, dialog, [dialog](const QStringList &args, const QString &/*workingDir*/) { + + QCommandLineParser parser; + parser.addOption(QCommandLineOption(QStringLiteral("args"), i18n("Arguments for the config module"), QStringLiteral("args"))); + parser.parse(args); + + dialog->clear(); + dialog->addModule(KPluginMetaData(QStringLiteral("kcm_kdeconnect")), {parser.value(QStringLiteral("args"))}); + }); + app.setQuitOnLastWindowClosed(true); return app.exec();