From 47fe1f7497f8e6cb73933b9e182d3b5c8ee6a33e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=80lex=20Fiestas?= Date: Wed, 18 Dec 2013 21:58:55 +0100 Subject: [PATCH] We shouldn't take "lock widgets" from corona, but only from containment It is up to the Containment to decide if the user is allowed or not to lock/unluck the widgets, so corona should not add one when there is none (user is not allow) and it shouldn't add another one when there is already one. Fixes duplicated action in toolbox. --- src/scriptengines/qml/plasmoid/containmentinterface.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/scriptengines/qml/plasmoid/containmentinterface.cpp b/src/scriptengines/qml/plasmoid/containmentinterface.cpp index be8c464b8..6460aa7d9 100644 --- a/src/scriptengines/qml/plasmoid/containmentinterface.cpp +++ b/src/scriptengines/qml/plasmoid/containmentinterface.cpp @@ -556,6 +556,13 @@ QList ContainmentInterface::actions() const } foreach (QAction *a, containment()->corona()->actions()->actions()) { if (a->isEnabled()) { + if (a->objectName() == QStringLiteral("lock widgets")) { + //It is up to the Containment to decide if the user is allowed or not + //to lock/unluck the widgets, so corona should not add one when there is none + //(user is not allow) and it shouldn't add another one when there is already + //one + continue; + } actions.insert(a->data().toInt(), a); } }