diff --git a/krunner/view.cpp b/krunner/view.cpp index f0702e774..cc1b3f374 100644 --- a/krunner/view.cpp +++ b/krunner/view.cpp @@ -159,7 +159,11 @@ void View::loadConfig() { setFreeFloating(m_config.readEntry("FreeFloating", false)); - const QStringList history = m_config.readEntry("history", QStringList()); + m_historyEnabled = m_config.readEntry("HistoryEnabled", true); + QStringList history; + if (m_historyEnabled) { + history = m_config.readEntry("history", QStringList()); + } if (m_history != history) { m_history = history; emit historyChanged(); @@ -377,6 +381,9 @@ QStringList View::history() const void View::addToHistory(const QString &item) { + if (!m_historyEnabled) { + return; + } if (item.isEmpty()) { return; } @@ -425,6 +432,9 @@ void View::removeFromHistory(int index) void View::writeHistory() { + if (!m_historyEnabled) { + return; + } m_config.writeEntry("history", m_history); } diff --git a/krunner/view.h b/krunner/view.h index 1ceb6704e..d2b98336c 100644 --- a/krunner/view.h +++ b/krunner/view.h @@ -106,6 +106,7 @@ private: bool m_requestedVisible = false; QStringList m_history; bool m_retainPriorSearch; + bool m_historyEnabled; }; diff --git a/lookandfeel/contents/runcommand/RunCommand.qml b/lookandfeel/contents/runcommand/RunCommand.qml index d5ced36ff..a6350c5f1 100644 --- a/lookandfeel/contents/runcommand/RunCommand.qml +++ b/lookandfeel/contents/runcommand/RunCommand.qml @@ -190,7 +190,7 @@ ColumnLayout { colorGroup: PlasmaCore.Theme.ButtonColorGroup } elementId: "down-arrow" - visible: queryField.length === 0 + visible: queryField.length === 0 && runnerWindow.history.length > 0 MouseArea { anchors.fill: parent