Changeset View
Changeset View
Standalone View
Standalone View
core/MenuItem.cpp
Show First 20 Lines • Show All 121 Lines • ▼ Show 20 Line(s) | |||||
122 | { | 122 | { | ||
123 | return d->menu; | 123 | return d->menu; | ||
124 | } | 124 | } | ||
125 | 125 | | |||
126 | void MenuItem::setService( const KService::Ptr& service ) | 126 | void MenuItem::setService( const KService::Ptr& service ) | ||
127 | { | 127 | { | ||
128 | d->service = service; | 128 | d->service = service; | ||
129 | d->category = service->property(QStringLiteral("X-KDE-System-Settings-Category")).toString(); | 129 | d->category = service->property(QStringLiteral("X-KDE-System-Settings-Category")).toString(); | ||
130 | if (d->category.isEmpty()) { | ||||
131 | d->category = service->property(QStringLiteral("X-KDE-KInfoCenter-Category")).toString(); | ||||
132 | } | ||||
130 | d->name = service->name(); | 133 | d->name = service->name(); | ||
131 | d->item = KCModuleInfo( service ); | 134 | d->item = KCModuleInfo( service ); | ||
132 | const QVariant itemWeight = service->property(QStringLiteral("X-KDE-Weight"), QVariant::Int ); | 135 | const QVariant itemWeight = service->property(QStringLiteral("X-KDE-Weight"), QVariant::Int ); | ||
133 | if( itemWeight.isValid() ) { | 136 | if( itemWeight.isValid() ) { | ||
134 | d->weight = itemWeight.toInt(); | 137 | d->weight = itemWeight.toInt(); | ||
135 | } else { | 138 | } else { | ||
136 | d->weight = 100; | 139 | d->weight = 100; | ||
137 | } | 140 | } | ||
138 | } | 141 | } |