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:
parent
0e4c0c8851
commit
0dba9044bf
@ -637,12 +637,9 @@ 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
|
||||||
@ -652,7 +649,6 @@ QList<QObject *> ContainmentInterface::actions() const
|
|||||||
}
|
}
|
||||||
actions.insert(a->data().toInt(), a);
|
actions.insert(a->data().toInt(), a);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return actions.values();
|
return actions.values();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user