Commit 853333c2 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[KRunner] Show configure button only if not forbidden by KIOSK restriction

Differential Revision: https://phabricator.kde.org/D9050
parent 6b8411c2
......@@ -28,6 +28,7 @@
#include <QClipboard>
#include <QPlatformSurfaceEvent>
#include <KAuthorized>
#include <KWindowSystem>
#include <KWindowEffects>
#include <KAuthorized>
......@@ -400,6 +401,11 @@ void View::displayConfiguration()
QProcess::startDetached(QStringLiteral("kcmshell5"), QStringList() << QStringLiteral("plasmasearch"));
}
bool View::canConfigure() const
{
return KAuthorized::authorizeControlModule(QStringLiteral("kcm_plasmasearch.desktop"));
}
QStringList View::history() const
{
return m_history;
......
......@@ -46,6 +46,7 @@ class View : public PlasmaQuick::Dialog
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kde.krunner.App")
Q_PROPERTY(bool canConfigure READ canConfigure CONSTANT)
Q_PROPERTY(QStringList history READ history NOTIFY historyChanged)
public:
......@@ -57,6 +58,7 @@ public:
bool freeFloating() const;
void setFreeFloating(bool floating);
bool canConfigure() const;
QStringList history() const;
Q_INVOKABLE void addToHistory(const QString &item);
......
......@@ -60,6 +60,7 @@ ColumnLayout {
}
Accessible.name: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Configure")
Accessible.description: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Configure Search Plugins")
visible: runnerWindow.canConfigure
}
PlasmaComponents.TextField {
id: queryField
......
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