Commit 65dfa07f authored by Aleksei Nikiforov's avatar Aleksei Nikiforov Committed by Yuri Chornoivan

Hide group menu items if they have no children

Differential revision: https://phabricator.kde.org/D27405
parent 4bb32e2d
......@@ -89,6 +89,7 @@ void NavigatorAppGroupItem::populate( bool recursive )
return;
}
KServiceGroup::List list = root->entries();
bool no_children_present = true;
for ( KServiceGroup::List::ConstIterator it = list.constBegin();
......@@ -106,6 +107,7 @@ void NavigatorAppGroupItem::populate( bool recursive )
DocEntry *entry = new DocEntry( s->name(), url, s->icon() );
NavigatorAppItem *item = new NavigatorAppItem( entry, this );
item->setAutoDeleteDocEntry( true );
no_children_present = false;
}
break;
}
......@@ -119,6 +121,7 @@ void NavigatorAppGroupItem::populate( bool recursive )
appItem = new NavigatorAppGroupItem( entry, this, g->relPath() );
appItem->setAutoDeleteDocEntry( true );
if ( recursive ) appItem->populate( recursive );
no_children_present = false;
break;
}
default:
......@@ -127,6 +130,7 @@ void NavigatorAppGroupItem::populate( bool recursive )
}
sortChildren( 0, Qt::AscendingOrder /* ascending */ );
mPopulated = true;
setHidden(no_children_present);
}
QString NavigatorAppGroupItem::documentationURL( const KService *s )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment