Changeset View
Changeset View
Standalone View
Standalone View
kcmshell/main.cpp
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Line(s) | 51 | { | |||
---|---|---|---|---|---|
52 | const int compare = QString::compare(s1->desktopEntryName(), | 52 | const int compare = QString::compare(s1->desktopEntryName(), | ||
53 | s2->desktopEntryName(), | 53 | s2->desktopEntryName(), | ||
54 | Qt::CaseInsensitive); | 54 | Qt::CaseInsensitive); | ||
55 | return (compare < 0); | 55 | return (compare < 0); | ||
56 | } | 56 | } | ||
57 | 57 | | |||
58 | static void listModules() | 58 | static void listModules() | ||
59 | { | 59 | { | ||
60 | const KService::List services = KServiceTypeTrader::self()->query( "KCModule", "[X-KDE-ParentApp] == 'kcontrol' or [X-KDE-ParentApp] == 'kinfocenter'" ); | 60 | // First condition is what systemsettings does, second what kinfocenter does, make sure this is kept in sync | ||
61 | // We need the exist calls because otherwise the trader language aborts if the property doesn't exist and the second part of the or is not evaluated | ||||
62 | const KService::List services = KServiceTypeTrader::self()->query( QStringLiteral("KCModule"), QStringLiteral("(exist [X-KDE-System-Settings-Parent-Category] and [X-KDE-System-Settings-Parent-Category] != '') or (exist [X-KDE-ParentApp] and [X-KDE-ParentApp] == 'kinfocenter')") ); | ||||
apol: Use QStringLiteral()? | |||||
61 | for( KService::List::const_iterator it = services.constBegin(); it != services.constEnd(); ++it) { | 63 | for( KService::List::const_iterator it = services.constBegin(); it != services.constEnd(); ++it) { | ||
62 | const KService::Ptr s = (*it); | 64 | const KService::Ptr s = (*it); | ||
63 | if (!KAuthorized::authorizeControlModule(s->menuId())) | 65 | if (!KAuthorized::authorizeControlModule(s->menuId())) | ||
64 | continue; | 66 | continue; | ||
65 | m_modules.append(s); | 67 | m_modules.append(s); | ||
66 | } | 68 | } | ||
67 | 69 | | |||
68 | qStableSort(m_modules.begin(), m_modules.end(), caseInsensitiveLessThan); | 70 | qStableSort(m_modules.begin(), m_modules.end(), caseInsensitiveLessThan); | ||
▲ Show 20 Lines • Show All 231 Lines • Show Last 20 Lines |
Use QStringLiteral()?