Changeset View
Changeset View
Standalone View
Standalone View
dataengines/apps/appsengine.cpp
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Line(s) | |||||
68 | { | 68 | { | ||
69 | if (!(group && group->isValid())) { | 69 | if (!(group && group->isValid())) { | ||
70 | return; | 70 | return; | ||
71 | } | 71 | } | ||
72 | AppSource *appSource = new AppSource(group, this); | 72 | AppSource *appSource = new AppSource(group, this); | ||
73 | //TODO listen for changes | 73 | //TODO listen for changes | ||
74 | addSource(appSource); | 74 | addSource(appSource); | ||
75 | //do children | 75 | //do children | ||
76 | foreach (const KServiceGroup::Ptr &subGroup, group->groupEntries(KServiceGroup::NoOptions)) { | 76 | const auto entries = group->groupEntries(KServiceGroup::NoOptions); | ||
77 | for (const KServiceGroup::Ptr &subGroup : entries) { | ||||
77 | addGroup(subGroup); | 78 | addGroup(subGroup); | ||
78 | } | 79 | } | ||
79 | foreach (const KService::Ptr &app, group->serviceEntries(KServiceGroup::NoOptions)) { | 80 | const auto serviceEntries = group->serviceEntries(KServiceGroup::NoOptions); | ||
81 | for (const KService::Ptr &app : serviceEntries) { | ||||
80 | addApp(app); | 82 | addApp(app); | ||
81 | } | 83 | } | ||
82 | } | 84 | } | ||
83 | 85 | | |||
84 | void AppsEngine::addApp(KService::Ptr app) | 86 | void AppsEngine::addApp(KService::Ptr app) | ||
85 | { | 87 | { | ||
86 | AppSource *appSource = new AppSource(app, this); | 88 | AppSource *appSource = new AppSource(app, this); | ||
87 | //TODO listen for changes | 89 | //TODO listen for changes | ||
88 | addSource(appSource); | 90 | addSource(appSource); | ||
89 | } | 91 | } | ||
90 | 92 | | |||
91 | K_EXPORT_PLASMA_DATAENGINE_WITH_JSON(apps, AppsEngine, "plasma-dataengine-apps.json") | 93 | K_EXPORT_PLASMA_DATAENGINE_WITH_JSON(apps, AppsEngine, "plasma-dataengine-apps.json") | ||
92 | 94 | | |||
93 | #include "appsengine.moc" | 95 | #include "appsengine.moc" |