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

Method setupActions

kdevplatform/shell/runtimecontroller.cpp:82–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82void RuntimeController::setupActions()
83{
84 // TODO not multi-window friendly, FIXME
85 KActionCollection* ac = m_core->uiControllerInternal()->defaultMainWindow()->actionCollection();
86
87 auto action = new QAction(this);
88 action->setToolTip(i18n("Allows to select a runtime"));
89 action->setMenu(m_runtimesMenu.data());
90 action->setIcon(QIcon::fromTheme(QStringLiteral("file-library-symbolic")));
91 auto updateActionText = [action](IRuntime* currentRuntime){
92 action->setText(i18n("Runtime: %1", currentRuntime->name()));
93 };
94 connect(this, &RuntimeController::currentRuntimeChanged, action, updateActionText);
95 updateActionText(m_currentRuntime);
96
97 ac->addAction(QStringLiteral("switch_runtimes"), action);
98}
99
100void KDevelop::RuntimeController::initialize()
101{

Callers

nothing calls this directly

Calls 9

defaultMainWindowMethod · 0.80
uiControllerInternalMethod · 0.80
setToolTipMethod · 0.80
setIconMethod · 0.80
actionCollectionMethod · 0.45
dataMethod · 0.45
setTextMethod · 0.45
nameMethod · 0.45
addActionMethod · 0.45

Tested by

no test coverage detected