| 50 | } |
| 51 | |
| 52 | void CommandPrivate::addOverrideAction(QAction *action, const QStringList &context) |
| 53 | { |
| 54 | if (action->menuRole() == QAction::TextHeuristicRole) |
| 55 | action->setMenuRole(QAction::NoRole); |
| 56 | |
| 57 | if (isEmpty()) |
| 58 | this->action->initialize(action); |
| 59 | |
| 60 | if (context.isEmpty()) { |
| 61 | contextActionMap.insert(C_GLOBAL, action); |
| 62 | } else { |
| 63 | for (const auto &id : context) { |
| 64 | if (contextActionMap.contains(id)) |
| 65 | qWarning("%s", qPrintable(msgActionWarning(action, id, contextActionMap.value(id, nullptr)))); |
| 66 | contextActionMap.insert(id, action); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | setCurrentContext(cmdContext); |
| 71 | } |
| 72 | |
| 73 | void CommandPrivate::removeOverrideAction(QAction *action) |
| 74 | { |
no test coverage detected