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.
This commit is contained in:
Àlex Fiestas 2013-12-18 21:58:55 +01:00
parent cddee3cbf2
commit 47fe1f7497

View File

@ -556,6 +556,13 @@ QList<QObject*> ContainmentInterface::actions() const
} }
foreach (QAction *a, containment()->corona()->actions()->actions()) { foreach (QAction *a, containment()->corona()->actions()->actions()) {
if (a->isEnabled()) { 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); actions.insert(a->data().toInt(), a);
} }
} }