From 9a77503f0bd9ce0ccd0e99c08e9feef76c99743a Mon Sep 17 00:00:00 2001 From: David Redondo Date: Mon, 25 Jul 2022 16:05:01 +0200 Subject: [PATCH] lookandfeelmanager: Write colors before color scheme While we indeed write both with KConfig::Notify flag interested processes might only listen to the scheme change instead of every color scheme group. When they react to the scheme change the colors have not yet changed. The colors kcm also does it in this order. BUG:421745 FIXED-IN:5.24.7 --- kcms/lookandfeel/lookandfeelmanager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kcms/lookandfeel/lookandfeelmanager.cpp b/kcms/lookandfeel/lookandfeelmanager.cpp index 499f97cae..54c860d3c 100644 --- a/kcms/lookandfeel/lookandfeelmanager.cpp +++ b/kcms/lookandfeel/lookandfeelmanager.cpp @@ -190,12 +190,13 @@ void LookAndFeelManager::setColors(const QString &scheme, const QString &colorFi KConfig configDefault(configDefaults(QStringLiteral("kdeglobals"))); auto kdeGlobalsCfg = KSharedConfig::openConfig(QStringLiteral("kdeglobals"), KConfig::FullConfig); - writeNewDefaults(*kdeGlobalsCfg, configDefault, QStringLiteral("General"), QStringLiteral("ColorScheme"), scheme, KConfig::Notify); if (m_mode == Mode::Apply) { applyScheme(colorFile, kdeGlobalsCfg.data(), KConfig::Notify); } + writeNewDefaults(*kdeGlobalsCfg, configDefault, QStringLiteral("General"), QStringLiteral("ColorScheme"), scheme, KConfig::Notify); + Q_EMIT colorsChanged(); }