void SlimeConfigResponse::fill() { if (_filled) { LOG(info, "SlimeConfigResponse::fill() called twice, probably a bug"); return; } Memory json((*_returnValues)[0]._string._str); Slime * data = new Slime(); JsonFormat::decode(json, *data); _data.reset(data); _key = readKey(); _state = readState(); _value = readConfigValue(); readTrace(); _filled = true; if (LOG_WOULD_LOG(debug)) { LOG(debug, "trace at return(%s)", _trace.toString().c_str()); } }
void updateKdeGlobals() { Kdelibs4Migration migration; //Apply the color scheme KConfig config(migration.saveLocation("config") + "kdeglobals"); KSharedConfig::Ptr kf5Config = KSharedConfig::openConfig("kdeglobals"); KConfigGroup kf5Group(kf5Config, "General"); KConfigGroup kf52Group(kf5Config, "KDE"); const QString looknfeel = kf52Group.readEntry("LookAndFeelPackage", defaultLookAndFeelPackage); KSharedConfigPtr lnfConfig; KSharedConfigPtr defaultLnfConfig = KSharedConfig::openConfig(QStandardPaths::locate(QStandardPaths::GenericDataLocation, "plasma/look-and-feel/" + defaultLookAndFeelPackage + "/contents/defaults")); if (looknfeel != defaultLookAndFeelPackage) { lnfConfig = KSharedConfig::openConfig(QStandardPaths::locate(QStandardPaths::GenericDataLocation, "plasma/look-and-feel/" + looknfeel + "/contents/defaults")); } const QString widgetStyle = readConfigValue(lnfConfig, defaultLnfConfig, "KDE", "widgetStyle", "Menda").toString(); const QString colorScheme = readConfigValue(lnfConfig, defaultLnfConfig, "General", "ColorScheme", "Menda").toString(); const QString icons = readConfigValue(lnfConfig, defaultLnfConfig, "Icons", "Theme", "menda").toString(); cloneColorScheme(colorScheme); //use only if the style from the look and feel package is installed const bool hasWidgetStyle = QStyleFactory::keys().contains(widgetStyle); KConfigGroup group(&config, "General"); group.writeEntry("ColorScheme", colorScheme); qDebug() << "setting widget style:" << widgetStyle << hasWidgetStyle; if (hasWidgetStyle) { group.writeEntry("widgetStyle", widgetStyle); //for some reason this seems necessary group.sync(); } applyColorScheme(colorScheme, &config); group.sync(); KConfigGroup iconGroup(&config, "Icons"); iconGroup.writeEntry("Theme", icons); applyColorScheme(colorScheme, &config); iconGroup.sync(); kf5Group.writeEntry("ColorScheme", colorScheme); kf5Group.sync(); if (hasWidgetStyle) { kf5Group.writeEntry("widgetStyle", widgetStyle); } applyColorScheme(colorScheme, kf5Group.config()); kf5Group.sync(); kf52Group.writeEntry("ColorScheme", colorScheme); if (hasWidgetStyle) { kf52Group.writeEntry("widgetStyle", widgetStyle); } applyColorScheme(colorScheme, kf52Group.config()); kf52Group.sync(); KConfigGroup kf5IconGroup(kf5Config, "Icons"); kf5IconGroup.writeEntry("Theme", icons); kf5IconGroup.sync(); }