Changeset View
Changeset View
Standalone View
Standalone View
kcms/colors/colors.cpp
Show First 20 Lines • Show All 337 Lines • ▼ Show 20 Line(s) | 336 | { | |||
---|---|---|---|---|---|
338 | KConfigGroup group(m_config, "General"); | 338 | KConfigGroup group(m_config, "General"); | ||
339 | group = KConfigGroup(&cfg, "X11"); | 339 | group = KConfigGroup(&cfg, "X11"); | ||
340 | m_applyToAlien = group.readEntry("exportKDEColors", true); | 340 | m_applyToAlien = group.readEntry("exportKDEColors", true); | ||
341 | } | 341 | } | ||
342 | } | 342 | } | ||
343 | 343 | | |||
344 | void KCMColors::save() | 344 | void KCMColors::save() | ||
345 | { | 345 | { | ||
346 | ManagedConfigModule::save(); | 346 | // We need to save the colors change first, to avoid a situation, | ||
347 | // when we announced that the color scheme has changed, but | ||||
348 | // the colors themselves in the color scheme have not yet | ||||
347 | if (m_selectedSchemeDirty) { | 349 | if (m_selectedSchemeDirty) { | ||
348 | saveColors(); | 350 | saveColors(); | ||
349 | } | 351 | } | ||
352 | ManagedConfigModule::save(); | ||||
350 | m_activeSchemeEdited = false; | 353 | m_activeSchemeEdited = false; | ||
351 | 354 | | |||
352 | processPendingDeletions(); | 355 | processPendingDeletions(); | ||
353 | } | 356 | } | ||
354 | 357 | | |||
355 | void KCMColors::saveColors() | 358 | void KCMColors::saveColors() | ||
356 | { | 359 | { | ||
357 | const QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, | 360 | const QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, | ||
▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Line(s) | 443 | for (const QString &groupName : groupNameList) { | |||
443 | 446 | | |||
444 | for (const QString &effect : effectList) { | 447 | for (const QString &effect : effectList) { | ||
445 | groupEffectOut.writeEntry(effect, groupEffectTheme.readEntry(effect)); | 448 | groupEffectOut.writeEntry(effect, groupEffectTheme.readEntry(effect)); | ||
446 | } | 449 | } | ||
447 | } | 450 | } | ||
448 | 451 | | |||
449 | m_config->sync(); | 452 | m_config->sync(); | ||
450 | 453 | | |||
451 | runRdb(KRdbExportQtColors | KRdbExportGtkTheme | KRdbExportGtkColors | (m_applyToAlien ? KRdbExportColors : 0)); | 454 | runRdb(KRdbExportQtColors | KRdbExportGtkTheme | (m_applyToAlien ? KRdbExportColors : 0)); | ||
452 | | ||||
453 | saveGtkColors(config); | | |||
454 | 455 | | |||
455 | QDBusMessage message = QDBusMessage::createSignal(QStringLiteral("/KGlobalSettings"), | 456 | QDBusMessage message = QDBusMessage::createSignal(QStringLiteral("/KGlobalSettings"), | ||
456 | QStringLiteral("org.kde.KGlobalSettings"), | 457 | QStringLiteral("org.kde.KGlobalSettings"), | ||
457 | QStringLiteral("notifyChange")); | 458 | QStringLiteral("notifyChange")); | ||
458 | message.setArguments({ | 459 | message.setArguments({ | ||
459 | 0, //previous KGlobalSettings::PaletteChanged. This is now private API in khintsettings | 460 | 0, //previous KGlobalSettings::PaletteChanged. This is now private API in khintsettings | ||
460 | 0 //unused in palette changed but needed for the DBus signature | 461 | 0 //unused in palette changed but needed for the DBus signature | ||
461 | }); | 462 | }); | ||
Show All 24 Lines |