diff --git a/krunner/view.cpp b/krunner/view.cpp index 4fd9f92b6..013862cb8 100644 --- a/krunner/view.cpp +++ b/krunner/view.cpp @@ -58,6 +58,8 @@ View::View(QWindow *) Q_UNUSED(names); if (group.name() == QLatin1String("General")) { loadConfig(); + } else if (group.name() == QLatin1String("Plugins")) { + Q_EMIT helpEnabledChanged(); } }); diff --git a/krunner/view.h b/krunner/view.h index 39d092f36..4cf7ebb42 100644 --- a/krunner/view.h +++ b/krunner/view.h @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -42,6 +43,7 @@ class View : public PlasmaQuick::Dialog Q_PROPERTY(QStringList history READ history NOTIFY historyChanged) // TODO KF6 This is kept for compatibility with third party themes which override the RunCommand.qml file Q_PROPERTY(Plasma::RunnerManager *runnerManager WRITE setRunnerManager) + Q_PROPERTY(bool helpEnabled READ helpEnabled NOTIFY helpEnabledChanged) public: explicit View(QWindow *parent = nullptr); @@ -69,8 +71,16 @@ public: m_manager = manager; } + bool helpEnabled() + { + const static auto metaData = KPluginMetaData(QStringLiteral("kf5/krunner/helprunner")); + const KConfigGroup grp = KSharedConfig::openConfig()->group("Plugins"); + return metaData.isEnabled(grp); + } + Q_SIGNALS: void pinnedChanged(); + void helpEnabledChanged(); protected: bool event(QEvent *event) override; diff --git a/lookandfeel/contents/runcommand/RunCommand.qml b/lookandfeel/contents/runcommand/RunCommand.qml index 83755144e..2750a8870 100644 --- a/lookandfeel/contents/runcommand/RunCommand.qml +++ b/lookandfeel/contents/runcommand/RunCommand.qml @@ -221,6 +221,7 @@ ColumnLayout { } } PlasmaComponents3.ToolButton { + visible: runnerWindow.helpEnabled checkable: true checked: root.query.startsWith("?") // Reset if out quers starts with "?", otherwise set it to "?"