diff --git a/applets/batterymonitor/package/contents/ui/PowerManagementItem.qml b/applets/batterymonitor/package/contents/ui/PowerManagementItem.qml --- a/applets/batterymonitor/package/contents/ui/PowerManagementItem.qml +++ b/applets/batterymonitor/package/contents/ui/PowerManagementItem.qml @@ -77,6 +77,7 @@ iconSource: "configure" onClicked: batterymonitor.action_powerdevilkcm() tooltip: i18n("Configure Power Saving...") + visible: batterymonitor.kcmsAuthorized } } diff --git a/applets/batterymonitor/package/contents/ui/batterymonitor.qml b/applets/batterymonitor/package/contents/ui/batterymonitor.qml --- a/applets/batterymonitor/package/contents/ui/batterymonitor.qml +++ b/applets/batterymonitor/package/contents/ui/batterymonitor.qml @@ -97,6 +97,11 @@ property var inhibitions: [] + readonly property var kcms: ["powerdevilprofilesconfig.desktop", + "powerdevilactivitiesconfig.desktop", + "powerdevilglobalconfig.desktop"] + readonly property bool kcmsAuthorized: KCMShell.authorize(batterymonitor.kcms).length > 0 + onScreenBrightnessChanged: { if (disableBrightnessUpdate) { return; @@ -120,14 +125,17 @@ } function action_powerdevilkcm() { - KCMShell.open(["powerdevilprofilesconfig", "powerdevilactivitiesconfig", "powerdevilglobalconfig"]); + KCMShell.open(batterymonitor.kcms); } Component.onCompleted: { Logic.updateBrightness(batterymonitor, pmSource); plasmoid.removeAction("configure"); - plasmoid.setAction("powerdevilkcm", i18n("&Configure Power Saving..."), "preferences-system-power-management"); Logic.updateInhibitions(batterymonitor, pmSource) + + if (batterymonitor.kcmsAuthorized) { + plasmoid.setAction("powerdevilkcm", i18n("&Configure Power Saving..."), "preferences-system-power-management"); + } } Plasmoid.compactRepresentation: CompactRepresentation { diff --git a/applets/digital-clock/package/contents/ui/main.qml b/applets/digital-clock/package/contents/ui/main.qml --- a/applets/digital-clock/package/contents/ui/main.qml +++ b/applets/digital-clock/package/contents/ui/main.qml @@ -83,8 +83,12 @@ } Component.onCompleted: { - plasmoid.setAction("clockkcm", i18n("Adjust Date and Time..."), "preferences-system-time"); - plasmoid.setAction("formatskcm", i18n("Set Time Format...")); + if (KCMShell.authorize("clock.desktop").length > 0) { + plasmoid.setAction("clockkcm", i18n("Adjust Date and Time..."), "preferences-system-time"); + } + if (KCMShell.authorize("formats.desktop").length > 0) { + plasmoid.setAction("formatskcm", i18n("Set Time Format...")); + } // Set the list of enabled plugins from config // to the manager