Commit 4a44b30b authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Add option to disable KRunner history

BUG: 376666
FIXED-IN: 5.20
parent ddd005b1
......@@ -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);
}
......
......@@ -106,6 +106,7 @@ private:
bool m_requestedVisible = false;
QStringList m_history;
bool m_retainPriorSearch;
bool m_historyEnabled;
};
......
......@@ -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
......
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