Changeset View
Changeset View
Standalone View
Standalone View
navigator.cpp
Show First 20 Lines • Show All 210 Lines • ▼ Show 20 Line(s) | 200 | */ | |||
---|---|---|---|---|---|
211 | } else if ( type == QLatin1String("filemanagercontrol") ) { | 211 | } else if ( type == QLatin1String("filemanagercontrol") ) { | ||
212 | list = KServiceTypeTrader::self()->query( QStringLiteral("KCModule"), filemanagercontrolconstraint ); | 212 | list = KServiceTypeTrader::self()->query( QStringLiteral("KCModule"), filemanagercontrolconstraint ); | ||
213 | } else if ( type == QLatin1String("othercontrol") ) { | 213 | } else if ( type == QLatin1String("othercontrol") ) { | ||
214 | list = KServiceTypeTrader::self()->query( QStringLiteral("KCModule"), othercontrolconstraint ); | 214 | list = KServiceTypeTrader::self()->query( QStringLiteral("KCModule"), othercontrolconstraint ); | ||
215 | } else if ( type == QLatin1String("kinfocenter") ) { | 215 | } else if ( type == QLatin1String("kinfocenter") ) { | ||
216 | list = KServiceTypeTrader::self()->query( QStringLiteral("KCModule"), QStringLiteral("[X-KDE-ParentApp] == 'kinfocenter'") ); | 216 | list = KServiceTypeTrader::self()->query( QStringLiteral("KCModule"), QStringLiteral("[X-KDE-ParentApp] == 'kinfocenter'") ); | ||
217 | } | 217 | } | ||
218 | 218 | | |||
219 | bool no_children_present = true; | ||||
220 | | ||||
219 | for ( KService::List::const_iterator it = list.constBegin(); it != list.constEnd(); ++it ) | 221 | for ( KService::List::const_iterator it = list.constBegin(); it != list.constEnd(); ++it ) | ||
220 | { | 222 | { | ||
221 | KService::Ptr s(*it); | 223 | KService::Ptr s(*it); | ||
222 | QString desktopFile = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("kservices5/") + s->entryPath() ); | 224 | QString desktopFile = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("kservices5/") + s->entryPath() ); | ||
223 | createItemFromDesktopFile( topItem, desktopFile ); | 225 | createItemFromDesktopFile( topItem, desktopFile ); | ||
226 | no_children_present = false; | ||||
224 | } | 227 | } | ||
225 | topItem->sortChildren( 0, Qt::AscendingOrder /* ascending */ ); | 228 | topItem->sortChildren( 0, Qt::AscendingOrder /* ascending */ ); | ||
229 | topItem->setHidden(no_children_present); | ||||
226 | } | 230 | } | ||
227 | 231 | | |||
228 | void Navigator::insertIOSlaveDocs( const QString &name, NavigatorItem *topItem ) | 232 | void Navigator::insertIOSlaveDocs( const QString &name, NavigatorItem *topItem ) | ||
229 | { | 233 | { | ||
230 | qCDebug(KHC_LOG) << "Requested IOSlave documents for ID" << name; | 234 | qCDebug(KHC_LOG) << "Requested IOSlave documents for ID" << name; | ||
231 | 235 | | |||
232 | QStringList list = KProtocolInfo::protocols(); | 236 | QStringList list = KProtocolInfo::protocols(); | ||
233 | list.sort(); | 237 | list.sort(); | ||
▲ Show 20 Lines • Show All 455 Lines • Show Last 20 Lines |