Changeset View
Changeset View
Standalone View
Standalone View
daemon/powerdevilprofilegenerator.cpp
Show All 40 Lines | 35 | if (!toDisk) { | |||
---|---|---|---|---|---|
41 | 41 | | |||
42 | PowerDevilSettings::self()->save(); | 42 | PowerDevilSettings::self()->save(); | ||
43 | } | 43 | } | ||
44 | 44 | | |||
45 | // Ok, let's get our config file. | 45 | // Ok, let's get our config file. | ||
46 | KSharedConfigPtr profilesConfig = KSharedConfig::openConfig("powermanagementprofilesrc", KConfig::SimpleConfig); | 46 | KSharedConfigPtr profilesConfig = KSharedConfig::openConfig("powermanagementprofilesrc", KConfig::SimpleConfig); | ||
47 | 47 | | |||
48 | // And clear it | 48 | // And clear it | ||
49 | Q_FOREACH (const QString &group, profilesConfig->groupList()) { | 49 | const QStringList groupList = profilesConfig->groupList(); | ||
50 | for (const QString &group : groupList) { | ||||
50 | // Don't delete activity-specific settings | 51 | // Don't delete activity-specific settings | ||
51 | if (group != "Activities") { | 52 | if (group != "Activities") { | ||
52 | profilesConfig->deleteGroup(group); | 53 | profilesConfig->deleteGroup(group); | ||
53 | } | 54 | } | ||
54 | } | 55 | } | ||
55 | 56 | | |||
56 | // Let's start: AC profile before anything else | 57 | // Let's start: AC profile before anything else | ||
57 | KConfigGroup acProfile(profilesConfig, "AC"); | 58 | KConfigGroup acProfile(profilesConfig, "AC"); | ||
▲ Show 20 Lines • Show All 95 Lines • Show Last 20 Lines |