MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / setCurrentContext

Method setCurrentContext

src/common/actionmanager/command.cpp:33–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33void 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
52void CommandPrivate::addOverrideAction(QAction *action, const QStringList &context)
53{

Callers 2

setContextMethod · 0.80
overridableActionMethod · 0.80

Calls 2

setActionMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected