diff --git a/applets/notifications/package/contents/ui/main.qml b/applets/notifications/package/contents/ui/main.qml --- a/applets/notifications/package/contents/ui/main.qml +++ b/applets/notifications/package/contents/ui/main.qml @@ -176,7 +176,7 @@ } function action_notificationskcm() { - ProcessRunner.runNotificationsKCM() + KCMShell.open("kcmnotify"); } Component.onCompleted: { @@ -186,7 +186,8 @@ return notificationsApplet.notifications && notificationsApplet.notifications.count > 0 }) - //var allApplications = new Object - plasmoid.setAction("notificationskcm", i18n("&Configure Event Notifications and Actions..."), "preferences-desktop-notification") + if (KCMShell.authorize("kcmnotify.desktop").length > 0) { + plasmoid.setAction("notificationskcm", i18n("&Configure Event Notifications and Actions..."), "preferences-desktop-notification") + } } } diff --git a/applets/notifications/plugin/notificationshelperplugin.cpp b/applets/notifications/plugin/notificationshelperplugin.cpp --- a/applets/notifications/plugin/notificationshelperplugin.cpp +++ b/applets/notifications/plugin/notificationshelperplugin.cpp @@ -51,32 +51,14 @@ return new UrlHelper(); } -class ProcessRunner : public QObject -{ - Q_OBJECT - public: - Q_INVOKABLE void runNotificationsKCM() const { - QProcess::startDetached(QStringLiteral("kcmshell5"), QStringList() << QStringLiteral("kcmnotify")); - } -}; - -static QObject *processrunner_singleton_provider(QQmlEngine *engine, QJSEngine *scriptEngine) -{ - Q_UNUSED(engine) - Q_UNUSED(scriptEngine) - - return new ProcessRunner(); -} - void NotificationsHelperPlugin::registerTypes(const char *uri) { Q_ASSERT(uri == QLatin1String("org.kde.plasma.private.notifications")); qmlRegisterType(uri, 1, 0, "NotificationsHelper"); qmlRegisterType(uri, 1, 0, "Thumbnailer"); qmlRegisterSingletonType(uri, 1, 0, "UrlHelper", urlcheck_singletontype_provider); - qmlRegisterSingletonType(uri, 1, 0, "ProcessRunner", processrunner_singleton_provider); } void NotificationsHelperPlugin::initializeEngine(QQmlEngine *engine, const char *uri)