Changeset View
Changeset View
Standalone View
Standalone View
src/plasma/service.cpp
Show First 20 Lines • Show All 170 Lines • ▼ Show 20 Line(s) | 169 | { | |||
---|---|---|---|---|---|
171 | 171 | | |||
172 | // /dev/null is because I need to pass a filename argument to construct a | 172 | // /dev/null is because I need to pass a filename argument to construct a | ||
173 | // KSharedConfig. We need a config object for the config loader even | 173 | // KSharedConfig. We need a config object for the config loader even | ||
174 | // though we dont' actually want to use any config parts from it, | 174 | // though we dont' actually want to use any config parts from it, | ||
175 | // we just want to share the KConfigLoader XML parsing. | 175 | // we just want to share the KConfigLoader XML parsing. | ||
176 | KSharedConfigPtr config = KSharedConfig::openConfig(QStringLiteral("/dev/null"), KConfig::SimpleConfig); | 176 | KSharedConfigPtr config = KSharedConfig::openConfig(QStringLiteral("/dev/null"), KConfig::SimpleConfig); | ||
177 | KConfigLoader loader(config, xml); | 177 | KConfigLoader loader(config, xml); | ||
178 | 178 | | |||
179 | foreach (const QString &group, loader.groupList()) { | 179 | const auto groupList = loader.groupList(); | ||
180 | for (const QString &group : groupList) { | ||||
180 | d->operationsMap[group][QStringLiteral("_name")] = group; | 181 | d->operationsMap[group][QStringLiteral("_name")] = group; | ||
181 | } | 182 | } | ||
182 | foreach (KConfigSkeletonItem *item, loader.items()) { | 183 | const auto itemsList = loader.items(); | ||
184 | for (KConfigSkeletonItem *item : itemsList) { | ||||
183 | d->operationsMap[item->group()][item->key()] = item->property(); | 185 | d->operationsMap[item->group()][item->key()] = item->property(); | ||
184 | } | 186 | } | ||
185 | } | 187 | } | ||
186 | 188 | | |||
187 | void Service::registerOperationsScheme() | 189 | void Service::registerOperationsScheme() | ||
188 | { | 190 | { | ||
189 | if (!d->operationsMap.isEmpty()) { | 191 | if (!d->operationsMap.isEmpty()) { | ||
190 | // we've already done our job. let's go home. | 192 | // we've already done our job. let's go home. | ||
Show All 26 Lines |