MCPcopy Create free account
hub / github.com/KDE/kdevelop / action

Method action

plugins/externalscript/externalscriptitem.cpp:103–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103QAction* ExternalScriptItem::action()
104{
105 ///TODO: this is quite ugly, or is it? if someone knows how to do it better, please refactor
106 if (!m_action) {
107 static int actionCount = 0;
108 m_action = new QAction(QStringLiteral("executeScript%1").arg(actionCount), ExternalScriptPlugin::self());
109 m_action->setData(QVariant::fromValue<ExternalScriptItem*>(this));
110 ExternalScriptPlugin::self()->connect(
111 m_action, &QAction::triggered,
112 ExternalScriptPlugin::self(), &ExternalScriptPlugin::executeScriptFromActionData
113 );
114 m_action->setShortcut(QKeySequence());
115 // action needs to be added to a widget before it can work...
116 KDevelop::ICore::self()->uiController()->activeMainWindow()->addAction(m_action);
117 }
118
119 Q_ASSERT(m_action);
120 return m_action;
121}
122
123bool ExternalScriptItem::showOutput() const
124{

Callers 4

ExternalScriptPluginMethod · 0.45
saveItemForRowMethod · 0.45
EditExternalScriptMethod · 0.45
saveMethod · 0.45

Calls 4

uiControllerMethod · 0.80
setDataMethod · 0.45
addActionMethod · 0.45
activeMainWindowMethod · 0.45

Tested by

no test coverage detected