From 66940389d66b1c9d04a058cf3632bb1c0b33171a Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Wed, 22 Jan 2020 09:45:26 -0700 Subject: [PATCH] [context menu] Remove last traces of "Lock Widgets" action from UI Summary: In Plasma, 5.18, this ishn't a user-facing option anymore. It's still visible in the context meny configuration dialog though, and it's still referenced in some of the context menu building code. This patch removes it from those places BUG: 416578 FIXED-IN: 5.18.0 Test Plan: Context menu still looks the same on the desktop and panel, both in and out of edit mode The action no longer shows up in the configuration UI. Please review carefully as this code is fairly unfamiliar to me. Reviewers: mart, #plasma Reviewed By: mart, #plasma Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D26845 --- containmentactions/contextmenu/menu.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/containmentactions/contextmenu/menu.cpp b/containmentactions/contextmenu/menu.cpp index ad33bb3e2..9b641bbd7 100644 --- a/containmentactions/contextmenu/menu.cpp +++ b/containmentactions/contextmenu/menu.cpp @@ -71,11 +71,11 @@ void ContextMenu::restore(const KConfigGroup &config) if (c->containmentType() == Plasma::Types::PanelContainment || c->containmentType() == Plasma::Types::CustomPanelContainment) { - m_actionOrder << QStringLiteral("add widgets") << QStringLiteral("_add panel") << QStringLiteral("lock widgets") << QStringLiteral("_context") << QStringLiteral("configure") << QStringLiteral("remove"); + m_actionOrder << QStringLiteral("add widgets") << QStringLiteral("_add panel") << QStringLiteral("_context") << QStringLiteral("configure") << QStringLiteral("remove"); } else { actions.insert(QStringLiteral("configure shortcuts"), false); m_actionOrder << QStringLiteral("_context") << QStringLiteral("_run_command") << QStringLiteral("add widgets") << QStringLiteral("_add panel") - << QStringLiteral("manage activities") << QStringLiteral("remove") << QStringLiteral("lock widgets") << QStringLiteral("edit mode") << QStringLiteral("_sep1") + << QStringLiteral("manage activities") << QStringLiteral("remove") << QStringLiteral("edit mode") << QStringLiteral("_sep1") < ContextMenu::contextualActions() // Bug 364292: show "Remove this Panel" option only when panelcontroller is opened if (name != QLatin1String("remove") || c->isUserConfiguring() || (c->containmentType() != Plasma::Types::PanelContainment - && c->containmentType() != Plasma::Types::CustomPanelContainment)) { - - if (name != QLatin1String("lock widgets") || c->corona()->immutability() != Plasma::Types::Mutable) { + && c->containmentType() != Plasma::Types::CustomPanelContainment + && c->corona()->immutability() != Plasma::Types::Mutable)) { actions << a; - } } } } @@ -178,10 +176,6 @@ QAction *ContextMenu::action(const QString &name) if (KAuthorized::authorize(QStringLiteral("logout"))) { return m_logoutAction; } - } else if (name == QLatin1String("lock widgets")) { - if (c->corona()) { - return c->corona()->actions()->action(QStringLiteral("lock widgets")); - } } else if (name == QLatin1String("edit mode")) { if (c->corona()) { return c->corona()->actions()->action(QStringLiteral("edit mode"));