KRunner: Disable help button when runner is disabled

BUG: 451509
wilder-5.25
Alexander Lohnau 4 years ago committed by Nate Graham
parent 88c3f46597
commit ae89638eef
  1. 2
      krunner/view.cpp
  2. 10
      krunner/view.h
  3. 1
      lookandfeel/contents/runcommand/RunCommand.qml

@ -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();
}
});

@ -8,6 +8,7 @@
#include <KConfigGroup>
#include <KConfigWatcher>
#include <KPluginMetaData>
#include <KSharedConfig>
#include <QPointer>
#include <QQuickView>
@ -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;

@ -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 "?"

Loading…
Cancel
Save