| 31 | } |
| 32 | |
| 33 | void CommandPrivate::setCurrentContext(const QStringList &context) |
| 34 | { |
| 35 | cmdContext = context; |
| 36 | |
| 37 | QAction *currentAction = nullptr; |
| 38 | for (const auto &id : std::as_const(context)) { |
| 39 | if (id == C_GLOBAL_CUTOFF) |
| 40 | break; |
| 41 | |
| 42 | if (QAction *a = contextActionMap.value(id, nullptr)) { |
| 43 | currentAction = a; |
| 44 | break; |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | action->setAction(currentAction); |
| 49 | updateActiveState(); |
| 50 | } |
| 51 | |
| 52 | void CommandPrivate::addOverrideAction(QAction *action, const QStringList &context) |
| 53 | { |
no test coverage detected