diff --git a/plasmoid/declarativeplugin/CMakeLists.txt b/plasmoid/declarativeplugin/CMakeLists.txt --- a/plasmoid/declarativeplugin/CMakeLists.txt +++ b/plasmoid/declarativeplugin/CMakeLists.txt @@ -6,7 +6,6 @@ set(kdeconnectdeclarativeplugin_SRC kdeconnectdeclarativeplugin.cpp responsewaiter.cpp - processrunner.cpp ) set(kdeconnectdeclarativeplugin_MOC diff --git a/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp b/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp --- a/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp +++ b/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp @@ -28,7 +28,6 @@ #include "objectfactory.h" #include "responsewaiter.h" -#include "processrunner.h" #include "interfaces/devicessortproxymodel.h" #include "interfaces/devicesmodel.h" @@ -85,7 +84,6 @@ qmlRegisterType(uri, 1, 0, "DevicesModel"); qmlRegisterType(uri, 1, 0, "NotificationsModel"); qmlRegisterType(uri, 1, 0, "DBusAsyncResponse"); - qmlRegisterType(uri, 1, 0, "ProcessRunner"); qmlRegisterType(uri, 1, 0, "DevicesSortProxyModel"); qmlRegisterUncreatableType(uri, 1, 0, "MprisDbusInterface", QStringLiteral("You're not supposed to instantiate interfacess")); qmlRegisterUncreatableType(uri, 1, 0, "LockDeviceDbusInterface", QStringLiteral("You're not supposed to instantiate interfacess")); diff --git a/plasmoid/declarativeplugin/processrunner.h b/plasmoid/declarativeplugin/processrunner.h deleted file mode 100644 --- a/plasmoid/declarativeplugin/processrunner.h +++ /dev/null @@ -1,36 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2013 by Eike Hein * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * - ***************************************************************************/ - -#ifndef PROCESSRUNNER_H -#define PROCESSRUNNER_H - -#include - -class ProcessRunner : public QObject -{ - Q_OBJECT - -public: - explicit ProcessRunner(QObject* parent = nullptr); - ~ProcessRunner() override; - - Q_INVOKABLE void runKdeconnectKCM(); -}; - -#endif diff --git a/plasmoid/declarativeplugin/processrunner.cpp b/plasmoid/declarativeplugin/processrunner.cpp deleted file mode 100644 --- a/plasmoid/declarativeplugin/processrunner.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2013 by Eike Hein * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * - ***************************************************************************/ - -#include "processrunner.h" - -#include - -ProcessRunner::ProcessRunner(QObject* parent) : QObject(parent) -{ -} - -ProcessRunner::~ProcessRunner() -{ -} - -void ProcessRunner::runKdeconnectKCM() -{ - QProcess::startDetached(QStringLiteral("kcmshell5"), QStringList() << QStringLiteral("kcm_kdeconnect")); -} diff --git a/plasmoid/package/contents/ui/main.qml b/plasmoid/package/contents/ui/main.qml --- a/plasmoid/package/contents/ui/main.qml +++ b/plasmoid/package/contents/ui/main.qml @@ -21,6 +21,7 @@ import QtQuick 2.1 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.plasmoid 2.0 +import org.kde.kquickcontrolsaddons 2.0 import org.kde.kdeconnect 1.0 Item @@ -49,16 +50,14 @@ Plasmoid.preferredRepresentation: isConstrained ? Plasmoid.compactRepresentation : Plasmoid.fullRepresentation - ProcessRunner { - id: processRunner - } - function action_launchkcm() { - processRunner.runKdeconnectKCM(); + KCMShell.open("kcm_kdeconnect"); } Component.onCompleted: { plasmoid.removeAction("configure"); - plasmoid.setAction("launchkcm", i18n("KDE Connect Settings..."), "configure"); + if (KCMShell.authorize("kcm_kdeconnect.desktop").length > 0) { + plasmoid.setAction("launchkcm", i18n("KDE Connect Settings..."), "configure"); + } } }