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

Method addRuntimes

kdevplatform/shell/runtimecontroller.cpp:131–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131void KDevelop::RuntimeController::addRuntimes(KDevelop::IRuntime * runtime)
132{
133 if (!runtime->parent())
134 runtime->setParent(this);
135
136 if (m_core->setupFlags() != Core::NoUi) {
137 auto* runtimeAction = new QAction(runtime->name(), m_runtimesMenu.data());
138 m_group->addAction(runtimeAction);
139 runtimeAction->setCheckable(true);
140 connect(runtimeAction, &QAction::triggered, runtime, [this, runtime]() {
141 setCurrentRuntime(runtime);
142 });
143 connect(this, &RuntimeController::currentRuntimeChanged, runtimeAction, [runtimeAction, runtime](IRuntime* currentRuntime) {
144 runtimeAction->setChecked(runtime == currentRuntime);
145 });
146
147 connect(runtime, &QObject::destroyed, this, [this, runtimeAction](QObject* obj) {
148 Q_ASSERT(m_currentRuntime != obj);
149 m_runtimes.removeAll(qobject_cast<KDevelop::IRuntime *>(obj));
150 delete runtimeAction;
151 });
152 m_runtimesMenu->addAction(runtimeAction);
153 } else {
154 connect(runtime, &QObject::destroyed, this, [this](QObject* obj) {
155 Q_ASSERT(m_currentRuntime != obj);
156 m_runtimes.removeAll(qobject_cast<KDevelop::IRuntime *>(obj));
157 });
158 }
159
160 m_runtimes << runtime;
161}
162
163#include "runtimecontroller.moc"
164#include "moc_runtimecontroller.cpp"

Callers 5

AndroidPluginMethod · 0.80
CraftPluginMethod · 0.80
imagesListFinishedMethod · 0.80
contextMenuExtensionMethod · 0.80
createRuntimeMethod · 0.80

Calls 6

setupFlagsMethod · 0.80
parentMethod · 0.45
setParentMethod · 0.45
nameMethod · 0.45
dataMethod · 0.45
addActionMethod · 0.45

Tested by

no test coverage detected