From ffa24a94b72928a7bf16d3978aca076bcd51dc69 Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Thu, 18 Mar 2021 08:10:18 +0100 Subject: [PATCH] krunner: Store pinned state in krunnerstaterc and not in config --- krunner/view.cpp | 8 ++++++-- krunner/view.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/krunner/view.cpp b/krunner/view.cpp index 65bfb8ac4..7cbb37397 100644 --- a/krunner/view.cpp +++ b/krunner/view.cpp @@ -62,6 +62,10 @@ View::View(QWindow *) setTitle(i18n("KRunner")); m_config = KConfigGroup(KSharedConfig::openConfig(), "General"); + m_stateData = KSharedConfig::openConfig(QStringLiteral("krunnerstaterc"), // + KConfig::NoGlobals, + QStandardPaths::GenericDataLocation) + ->group("General"); m_configWatcher = KConfigWatcher::create(KSharedConfig::openConfig()); connect(m_configWatcher.data(), &KConfigWatcher::configChanged, this, [this](const KConfigGroup &group, const QByteArrayList &names) { Q_UNUSED(names); @@ -156,7 +160,7 @@ void View::setFreeFloating(bool floating) void View::loadConfig() { setFreeFloating(m_config.readEntry("FreeFloating", false)); - setPinned(m_config.readEntry("Pinned", false)); + setPinned(m_stateData.readEntry("Pinned", false)); } bool View::event(QEvent *event) @@ -375,7 +379,7 @@ void View::setPinned(bool pinned) { if (m_pinned != pinned) { m_pinned = pinned; - m_config.writeEntry("Pinned", pinned); + m_stateData.writeEntry("Pinned", pinned); Q_EMIT pinnedChanged(); } } diff --git a/krunner/view.h b/krunner/view.h index 0c7ec48f8..c16d7751e 100644 --- a/krunner/view.h +++ b/krunner/view.h @@ -99,6 +99,7 @@ private: QPoint m_customPos; KDeclarative::QmlObject *m_qmlObj; KConfigGroup m_config; + KConfigGroup m_stateData; KConfigWatcher::Ptr m_configWatcher; qreal m_offset; bool m_floating : 1;