diff --git a/applets/kicker/plugin/recentusagemodel.cpp b/applets/kicker/plugin/recentusagemodel.cpp index 87232ce4b..f9c01bfbb 100644 --- a/applets/kicker/plugin/recentusagemodel.cpp +++ b/applets/kicker/plugin/recentusagemodel.cpp @@ -230,12 +230,16 @@ QVariant RecentUsageModel::appData(const QString &resource, int role) const const QVariantList &jumpList = Kicker::jumpListActions(service); if (!jumpList.isEmpty()) { - actionList << jumpList << Kicker::createSeparatorActionItem(); + actionList << jumpList; } const QVariantList &recentDocuments = Kicker::recentDocumentActions(service); if (!recentDocuments.isEmpty()) { - actionList << recentDocuments << Kicker::createSeparatorActionItem(); + actionList << recentDocuments; + } + + if (!actionList.isEmpty()) { + actionList << Kicker::createSeparatorActionItem(); } const QVariantMap &forgetAction = Kicker::createActionItem(i18n("Forget Application"), QStringLiteral("edit-clear-history"), QStringLiteral("forget")); diff --git a/applets/kicker/plugin/runnermatchesmodel.cpp b/applets/kicker/plugin/runnermatchesmodel.cpp index 8c70382ec..a01ffd701 100644 --- a/applets/kicker/plugin/runnermatchesmodel.cpp +++ b/applets/kicker/plugin/runnermatchesmodel.cpp @@ -122,13 +122,20 @@ QVariant RunnerMatchesModel::data(const QModelIndex &index, int role) const } const QVariantList &addLauncherActions = Kicker::createAddLauncherActionList(appletInterface, service); + bool needsSeparator = false; if (!systemImmutable && !addLauncherActions.isEmpty()) { - actionList << addLauncherActions << Kicker::createSeparatorActionItem(); + actionList << addLauncherActions; + needsSeparator = true; } const QVariantList &recentDocuments = Kicker::recentDocumentActions(service); if (!recentDocuments.isEmpty()) { - actionList << recentDocuments << Kicker::createSeparatorActionItem(); + actionList << recentDocuments; + needsSeparator = false; + } + + if (needsSeparator) { + actionList << Kicker::createSeparatorActionItem(); } const QVariantList &additionalActions = Kicker::additionalAppActions(service);