Changeset View
Changeset View
Standalone View
Standalone View
containmentactions/applauncher/launch.cpp
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | 42 | { | |||
---|---|---|---|---|---|
44 | m_actions.clear(); | 44 | m_actions.clear(); | ||
45 | makeMenu(nullptr, m_group); | 45 | makeMenu(nullptr, m_group); | ||
46 | 46 | | |||
47 | return m_actions; | 47 | return m_actions; | ||
48 | } | 48 | } | ||
49 | 49 | | |||
50 | void AppLauncher::makeMenu(QMenu *menu, const KServiceGroup::Ptr group) | 50 | void AppLauncher::makeMenu(QMenu *menu, const KServiceGroup::Ptr group) | ||
51 | { | 51 | { | ||
52 | foreach (KSycocaEntry::Ptr p, group->entries(true, true, true)) { | 52 | const auto entries = group->entries(true, true, true); | ||
53 | for (KSycocaEntry::Ptr p : entries) { | ||||
53 | if (p->isType(KST_KService)) { | 54 | if (p->isType(KST_KService)) { | ||
54 | const KService::Ptr service(static_cast<KService*>(p.data())); | 55 | const KService::Ptr service(static_cast<KService*>(p.data())); | ||
55 | 56 | | |||
56 | QString text = service->name(); | 57 | QString text = service->name(); | ||
57 | if (!m_showAppsByName && !service->genericName().isEmpty()) { | 58 | if (!m_showAppsByName && !service->genericName().isEmpty()) { | ||
58 | text = service->genericName(); | 59 | text = service->genericName(); | ||
59 | } | 60 | } | ||
60 | 61 | | |||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |