diff --git a/applets/kicker/plugin/appsmodel.cpp b/applets/kicker/plugin/appsmodel.cpp --- a/applets/kicker/plugin/appsmodel.cpp +++ b/applets/kicker/plugin/appsmodel.cpp @@ -461,6 +461,43 @@ m_sorted, m_showSeparators, m_appNameFormat); m_entryList << groupEntry; } + } else if (p->isType(KST_KService)) { + const KService::Ptr service(static_cast(p.data())); + + if (service->noDisplay()) { + continue; + } + + bool found = false; + + foreach (const AbstractEntry *entry, m_entryList) { + if (entry->type() == AbstractEntry::RunnableType + && static_cast(entry)->service()->storageId() == service->storageId()) { + found = true; + } + } + + if (!found) { + m_entryList << new AppEntry(this, service, m_appNameFormat); + } + } else if (p->isType(KST_KServiceSeparator) && m_showSeparators) { + if (!m_entryList.count()) { + continue; + } + + if (m_entryList.last()->type() == AbstractEntry::SeparatorType) { + continue; + } + + m_entryList << new SeparatorEntry(this); + ++m_separatorCount; + } + } + + if (m_entryList.count()) { + while (m_entryList.last()->type() == AbstractEntry::SeparatorType) { + m_entryList.removeLast(); + --m_separatorCount; } } diff --git a/applets/kicker/plugin/rootmodel.cpp b/applets/kicker/plugin/rootmodel.cpp --- a/applets/kicker/plugin/rootmodel.cpp +++ b/applets/kicker/plugin/rootmodel.cpp @@ -310,6 +310,8 @@ foreach (const AbstractEntry *groupEntry, m_entryList) { AbstractModel *model = groupEntry->childModel(); + if (!model) continue; + for (int i = 0; i < model->count(); ++i) { GroupEntry *subGroupEntry = static_cast(model->index(i, 0).internalPointer()); AbstractModel *subModel = subGroupEntry->childModel(); @@ -369,6 +371,8 @@ foreach (const AbstractEntry *groupEntry, m_entryList) { AbstractModel *model = groupEntry->childModel(); + if (!model) continue; + for (int i = 0; i < model->count(); ++i) { AbstractEntry *appEntry = static_cast(model->index(i, 0).internalPointer());