actions() returns the complete list

the disabled/invisible actions already have it as properties.
this fixes the add widgets action sometimes not being available
in the toolbox
Reviewed by: Bhushan Shah <bhush94@gmail.com>
This commit is contained in:
Marco Martin 2014-07-07 19:35:11 +02:00
parent 0e4c0c8851
commit 0dba9044bf

View File

@ -637,21 +637,17 @@ QList<QObject *> ContainmentInterface::actions() const
//use a multimap to sort by action type //use a multimap to sort by action type
QMultiMap<int, QObject *> actions; QMultiMap<int, QObject *> actions;
foreach (QAction *a, containment()->actions()->actions()) { foreach (QAction *a, containment()->actions()->actions()) {
if (a->isEnabled()) { actions.insert(a->data().toInt(), a);
actions.insert(a->data().toInt(), a);
}
} }
foreach (QAction *a, containment()->corona()->actions()->actions()) { foreach (QAction *a, containment()->corona()->actions()->actions()) {
if (a->isEnabled()) { if (a->objectName() == QStringLiteral("lock widgets")) {
if (a->objectName() == QStringLiteral("lock widgets")) { //It is up to the Containment to decide if the user is allowed or not
//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
//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
//(user is not allow) and it shouldn't add another one when there is already //one
//one continue;
continue;
}
actions.insert(a->data().toInt(), a);
} }
actions.insert(a->data().toInt(), a);
} }
return actions.values(); return actions.values();
} }