diff --git a/applets/kicker/plugin/appentry.cpp b/applets/kicker/plugin/appentry.cpp --- a/applets/kicker/plugin/appentry.cpp +++ b/applets/kicker/plugin/appentry.cpp @@ -47,6 +47,8 @@ #include #include +#include + MenuEntryEditor *AppEntry::m_menuEntryEditor = nullptr; AppEntry::AppEntry(AbstractModel *owner, KService::Ptr service, NameFormat nameFormat) @@ -146,8 +148,10 @@ QObject *appletInterface = m_owner->rootModel()->property("appletInterface").value(); + const bool systemImmutable = appletInterface->property("immutability").toInt() == Plasma::Types::SystemImmutable; + const QVariantList &addLauncherActions = Kicker::createAddLauncherActionList(appletInterface, m_service); - if (!addLauncherActions.isEmpty()) { + if (!systemImmutable && !addLauncherActions.isEmpty()) { actionList << addLauncherActions << Kicker::createSeparatorActionItem(); } @@ -157,6 +161,12 @@ actionList << recentDocuments << Kicker::createSeparatorActionItem(); } + // Don't allow adding launchers, editing, hiding, or uninstalling applications + // when system is immutable. + if (systemImmutable) { + return actionList; + } + if (m_menuEntryEditor->canEdit(m_service->entryPath())) { actionList << Kicker::createSeparatorActionItem(); diff --git a/applets/kickoff/package/contents/code/tools.js b/applets/kickoff/package/contents/code/tools.js --- a/applets/kickoff/package/contents/code/tools.js +++ b/applets/kickoff/package/contents/code/tools.js @@ -37,6 +37,11 @@ } function createFavoriteAction(favoriteModel, favoriteId) { + // Don't allow changes to favorites when system is immutable. + if (plasmoid.immutability === PlasmaCore.Types.SystemImmutable) { + return null; + } + if (favoriteModel === null || !favoriteModel.enabled || favoriteId == null) { return null; } diff --git a/applets/kickoff/package/contents/ui/ActionMenu.qml b/applets/kickoff/package/contents/ui/ActionMenu.qml --- a/applets/kickoff/package/contents/ui/ActionMenu.qml +++ b/applets/kickoff/package/contents/ui/ActionMenu.qml @@ -42,7 +42,7 @@ } function open(x, y) { - if (!actionList) { + if (!actionList || !actionList.length) { return; } diff --git a/applets/kickoff/package/contents/ui/FavoritesView.qml b/applets/kickoff/package/contents/ui/FavoritesView.qml --- a/applets/kickoff/package/contents/ui/FavoritesView.qml +++ b/applets/kickoff/package/contents/ui/FavoritesView.qml @@ -112,6 +112,11 @@ } onDragEnter: { + // Don't allow re-arranging favorites when system is immutable. + if (plasmoid.immutability === PlasmaCore.Types.SystemImmutable) { + return + } + dragUrl = kickoffListView.currentItem.url; startRow = kickoffListView.currentIndex; syncTarget(event); diff --git a/applets/kickoff/package/contents/ui/Kickoff.qml b/applets/kickoff/package/contents/ui/Kickoff.qml --- a/applets/kickoff/package/contents/ui/Kickoff.qml +++ b/applets/kickoff/package/contents/ui/Kickoff.qml @@ -108,6 +108,8 @@ } Component.onCompleted: { - plasmoid.setAction("menuedit", i18n("Edit Applications...")); + if (plasmoid.immutability !== PlasmaCore.Types.SystemImmutable) { + plasmoid.setAction("menuedit", i18n("Edit Applications...")); + } } } // root