File indexing completed on 2024-05-12 05:28:48

0001 #include <KColorScheme>
0002 #include <KConfig>
0003 #include <KConfigGroup>
0004 
0005 #include <QDebug>
0006 
0007 int main(int, char**)
0008 {
0009     KConfig globals("kdeglobals");
0010     KConfigGroup general(&globals, QStringLiteral("General"));
0011     if (general.readEntry("ColorScheme") != QLatin1String("Breeze")) {
0012         return 0;
0013     }
0014     QString breezeLightPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("color-schemes/BreezeLight.colors"));
0015     if (breezeLightPath.isEmpty()) {
0016         return 0;
0017     }
0018     KConfig breezeLight(breezeLightPath, KConfig::SimpleConfig);
0019     for (const auto &group : breezeLight.groupList()) {
0020         auto destination = KConfigGroup(&globals, group);
0021         KConfigGroup(&breezeLight, group).copyTo(&destination, KConfig::Notify);
0022     }
0023     return 0;
0024 }