From f01f751708d0a7c3e06cf9a41c09e6a29a8e3996 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 24 May 2017 19:59:04 +0200 Subject: [PATCH] Use a KCMultiDialog instead of calling kcmshell directly Reviewed by Aleix --- indicator/CMakeLists.txt | 3 ++- indicator/main.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/indicator/CMakeLists.txt b/indicator/CMakeLists.txt index 32ab91784..811d3ad13 100644 --- a/indicator/CMakeLists.txt +++ b/indicator/CMakeLists.txt @@ -1,6 +1,7 @@ find_package(KF5Notifications REQUIRED) +find_package(KF5KCMUtils REQUIRED) add_executable(kdeconnect-indicator main.cpp deviceindicator.cpp) -target_link_libraries(kdeconnect-indicator Qt5::Widgets KF5::CoreAddons KF5::I18n KF5::Notifications kdeconnectinterfaces) +target_link_libraries(kdeconnect-indicator Qt5::Widgets KF5::CoreAddons KF5::I18n KF5::Notifications KF5::KCMUtils kdeconnectinterfaces) install(TARGETS kdeconnect-indicator ${INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/indicator/main.cpp b/indicator/main.cpp index 411253a27..aade695a5 100644 --- a/indicator/main.cpp +++ b/indicator/main.cpp @@ -32,6 +32,7 @@ #endif #include +#include #include #include "interfaces/devicesmodel.h" @@ -61,7 +62,9 @@ int main(int argc, char** argv) menu->clear(); auto configure = menu->addAction(i18n("Configure...")); QObject::connect(configure, &QAction::triggered, configure, [](){ - QProcess::startDetached("kcmshell5", {"kdeconnect"}); + KCMultiDialog dialog; + dialog.addModule("kcm_kdeconnect"); + dialog.exec(); }); for (int i=0, count = model.rowCount(); i