From 697784abcef53d75507fc738d2d9f3121794b04e Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sun, 12 Apr 2026 01:20:40 +1000 Subject: [PATCH] fix: remove key from loaded keys on sync A sync goes through the property setter, which sets the key as loaded. But a sync is not considered an explicit set, so unset it after --- plugin/src/Caelestia/Config/configobject.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugin/src/Caelestia/Config/configobject.cpp b/plugin/src/Caelestia/Config/configobject.cpp index 00769941..4e198a41 100644 --- a/plugin/src/Caelestia/Config/configobject.cpp +++ b/plugin/src/Caelestia/Config/configobject.cpp @@ -161,6 +161,7 @@ void ConfigObject::syncFromGlobal(ConfigObject* global) { if (!m_loadedKeys.contains(key)) { auto val = prop.read(global); prop.write(this, val); + m_loadedKeys.remove(key); // setter added it — remove since this is a synced value qCDebug(lcConfig) << " Synced" << key << "=" << val << "from global"; } else { qCDebug(lcConfig) << " Keeping loaded" << key << "=" << prop.read(this); @@ -206,8 +207,10 @@ void ConfigObject::resyncFromGlobal() { if (!prop.isWritable()) continue; - if (!m_loadedKeys.contains(key)) + if (!m_loadedKeys.contains(key)) { prop.write(this, prop.read(m_global)); + m_loadedKeys.remove(key); // setter added it — remove since this is a synced value + } } } @@ -219,6 +222,9 @@ void ConfigObject::onGlobalPropertiesChanged(const QMap& chan int idx = metaObject()->indexOfProperty(it.key().toUtf8().constData()); if (idx >= 0) { metaObject()->property(idx).write(this, it.value()); + // Remove the key that was added by markPropertyLoaded in the setter — + // this is a synced value, not an explicit override + m_loadedKeys.remove(it.key()); qCDebug(lcConfig) << metaObject()->className() << "synced" << it.key() << "=" << it.value() << "from global change"; }