Changeset View
Changeset View
Standalone View
Standalone View
kcms/keys/kglobalshortcutseditor.cpp
Show First 20 Lines • Show All 167 Lines • ▼ Show 20 Line(s) | 166 | if (group && group->isValid()) { | |||
---|---|---|---|---|---|
168 | 168 | | |||
169 | for( KServiceGroup::List::ConstIterator it = list.constBegin(); | 169 | for( KServiceGroup::List::ConstIterator it = list.constBegin(); | ||
170 | it != list.constEnd(); ++it) { | 170 | it != list.constEnd(); ++it) { | ||
171 | const KSycocaEntry::Ptr p = (*it); | 171 | const KSycocaEntry::Ptr p = (*it); | ||
172 | 172 | | |||
173 | if (p->isType(KST_KService)) { | 173 | if (p->isType(KST_KService)) { | ||
174 | const KService::Ptr service(static_cast<KService*>(p.data())); | 174 | const KService::Ptr service(static_cast<KService*>(p.data())); | ||
175 | 175 | | |||
176 | if (!service->noDisplay()) { | 176 | const QVariant noGlobalshortcut = service->property(QStringLiteral("X-KDE-NoGlobalShortcut")); | ||
177 | if (!(noGlobalshortcut.isValid() && noGlobalshortcut.toBool())) { | ||||
177 | QString genericName = service->genericName(); | 178 | QString genericName = service->genericName(); | ||
178 | if (genericName.isNull()) { | 179 | if (genericName.isNull()) { | ||
179 | genericName = service->comment(); | 180 | genericName = service->comment(); | ||
180 | } | 181 | } | ||
181 | QString description; | 182 | QString description; | ||
182 | if (!service->genericName().isEmpty() && service->genericName() != service->name()) { | 183 | if (!service->genericName().isEmpty() && service->genericName() != service->name()) { | ||
183 | description = service->genericName(); | 184 | description = service->genericName(); | ||
184 | } else if (!service->comment().isEmpty()) { | 185 | } else if (!service->comment().isEmpty()) { | ||
185 | description = service->comment(); | 186 | description = service->comment(); | ||
186 | } | 187 | } | ||
187 | 188 | | |||
188 | QStandardItem *subItem = new QStandardItem(QIcon::fromTheme(service->icon()), service->name()); | 189 | QStandardItem *subItem = new QStandardItem(QIcon::fromTheme(service->icon()), service->name()); | ||
189 | subItem->setData(service->entryPath()); | 190 | subItem->setData(service->entryPath()); | ||
190 | if (item) { | 191 | if (item) { | ||
191 | item->appendRow(subItem); | 192 | item->appendRow(subItem); | ||
192 | } else { | 193 | } else { | ||
193 | model->appendRow(subItem); | 194 | model->appendRow(subItem); | ||
194 | } | 195 | } | ||
195 | } | 196 | } | ||
196 | 197 | | |||
197 | } else if (p->isType(KST_KServiceGroup)) { | 198 | } else if (p->isType(KST_KServiceGroup)) { | ||
198 | KServiceGroup::Ptr subGroup(static_cast<KServiceGroup*>(p.data())); | 199 | KServiceGroup::Ptr subGroup(static_cast<KServiceGroup*>(p.data())); | ||
199 | 200 | | |||
200 | if (!subGroup->noDisplay() && subGroup->childCount() > 0) { | 201 | const QVariant noGlobalshortcut = subGroup->property(QStringLiteral("X-KDE-NoGlobalShortcut")); | ||
202 | if (!(noGlobalshortcut.isValid() && noGlobalshortcut.toBool()) && subGroup->childCount() > 0) { | ||||
201 | if (item) { | 203 | if (item) { | ||
202 | loadAppsCategory(subGroup, model, item); | 204 | loadAppsCategory(subGroup, model, item); | ||
203 | } else { | 205 | } else { | ||
204 | QStandardItem *subItem = new QStandardItem(QIcon::fromTheme(subGroup->icon()), subGroup->caption()); | 206 | QStandardItem *subItem = new QStandardItem(QIcon::fromTheme(subGroup->icon()), subGroup->caption()); | ||
205 | model->appendRow(subItem); | 207 | model->appendRow(subItem); | ||
206 | loadAppsCategory(subGroup, model, subItem); | 208 | loadAppsCategory(subGroup, model, subItem); | ||
207 | } | 209 | } | ||
208 | } | 210 | } | ||
▲ Show 20 Lines • Show All 638 Lines • Show Last 20 Lines |