From b6bbc208aa030856622dadf2d82485190d2bc502 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Fri, 7 Aug 2015 18:47:53 +0200 Subject: [PATCH] list applications more in depth go recursively in deep categories, without being recursive this makes all apps to appear and not only those at the first level of subcategories --- containments/homescreen/applicationlistmodel.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/containments/homescreen/applicationlistmodel.cpp b/containments/homescreen/applicationlistmodel.cpp index f1a34f0a..16c40862 100644 --- a/containments/homescreen/applicationlistmodel.cpp +++ b/containments/homescreen/applicationlistmodel.cpp @@ -101,8 +101,9 @@ void ApplicationListModel::loadApplications() QList unorderedList; // Iterate over all entries in the group - for(KServiceGroup::List::ConstIterator it = subGroupList.constBegin(); it != subGroupList.constEnd(); it++) { - KSycocaEntry::Ptr groupEntry = (*it); + while (!subGroupList.isEmpty()) { + KSycocaEntry::Ptr groupEntry = subGroupList.first(); + subGroupList.pop_front(); if (groupEntry->isType(KST_KServiceGroup)) { KServiceGroup::Ptr serviceGroup(static_cast(groupEntry.data())); @@ -114,7 +115,11 @@ void ApplicationListModel::loadApplications() KSycocaEntry::Ptr entry = (*it); ApplicationData data; - if (entry->property("Exec").isValid()) { + if (entry->isType(KST_KServiceGroup)) { + KServiceGroup::Ptr serviceGroup(static_cast(entry.data())); + subGroupList << serviceGroup; + + } else if (entry->property("Exec").isValid()) { KService::Ptr service(static_cast(entry.data())); qDebug() << " desktopEntryName: " << service->desktopEntryName();