Commit ffa24a94 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

krunner: Store pinned state in krunnerstaterc and not in config

parent 9c97ee51
......@@ -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();
}
}
......@@ -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;
......
Supports Markdown
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