Commit 6d3f2916 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[Widget Explorer] Hide "Download New Widgets" if GHNS is disabled by KIOSK restriction

parent 1bd31456
......@@ -26,6 +26,7 @@
#include <QQmlExpression>
#include <QQmlProperty>
#include <KAuthorized>
#include <klocalizedstring.h>
#include <KNewStuff3/KNS3/DownloadDialog>
#include <KWindowSystem>
......@@ -208,10 +209,14 @@ QList <QObject *> WidgetExplorer::widgetsMenuActions()
{
QList <QObject *> actionList;
WidgetAction *action = new WidgetAction(QIcon::fromTheme(QStringLiteral("applications-internet")),
i18n("Download New Plasma Widgets"), this);
connect(action, &QAction::triggered, this, &WidgetExplorer::downloadWidgets);
actionList << action;
WidgetAction *action = nullptr;
if (KAuthorized::authorize(QStringLiteral("ghns"))) {
action = new WidgetAction(QIcon::fromTheme(QStringLiteral("applications-internet")),
i18n("Download New Plasma Widgets"), this);
connect(action, &QAction::triggered, this, &WidgetExplorer::downloadWidgets);
actionList << action;
}
action = new WidgetAction(this);
action->setSeparator(true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment