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

Method addOverrideAction

src/common/actionmanager/command.cpp:52–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52void 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
73void CommandPrivate::removeOverrideAction(QAction *action)
74{

Callers 1

registerActionMethod · 0.80

Calls 7

isEmptyFunction · 0.85
msgActionWarningFunction · 0.85
insertMethod · 0.80
initializeMethod · 0.45
isEmptyMethod · 0.45
containsMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected