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

Method createRuntime

plugins/flatpak/flatpakplugin.cpp:141–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141void FlatpakPlugin::createRuntime(const KDevelop::Path &file, const QString &arch)
142{
143 IProject* project = ICore::self()->projectController()->findProjectForUrl(file.toUrl());
144 const KDevelop::Path path(flatpakBuildDirPath(project, arch));
145 if (path.isEmpty()) {
146 return;
147 }
148
149 auto* const process =
150 FlatpakRuntime::createBuildDirectory(path, file, arch, FlatpakRuntime::CreationMode::DisableUpdates);
151 connect(process, &KJob::finished, this, [this, path, file, arch](KJob* job) {
152 if (job->error() != 0) {
153 QDir(path.toLocalFile()).removeRecursively();
154 return;
155 }
156
157 auto rt = new FlatpakRuntime(path, file, arch);
158 m_runtimes += rt;
159 connect(rt, &QObject::destroyed, this, [this, rt]() {
160 m_runtimes.removeAll(rt);
161 });
162 ICore::self()->runtimeController()->addRuntimes(rt);
163 auto p = ICore::self()->projectController()->findProjectForUrl(file.toUrl());
164 if (p) {
165 auto config = p->projectConfiguration()->group(QStringLiteral("Flatpak"));
166 config.writeEntry("File", file.toUrl());
167 }
168 });
169 process->start();
170}
171
172static QStringList availableArches(const QJsonObject& doc)
173{

Callers

nothing calls this directly

Calls 14

flatpakBuildDirPathFunction · 0.85
findProjectForUrlMethod · 0.80
projectControllerMethod · 0.80
removeRecursivelyMethod · 0.80
toLocalFileMethod · 0.80
addRuntimesMethod · 0.80
runtimeControllerMethod · 0.80
writeEntryMethod · 0.80
QDirClass · 0.50
toUrlMethod · 0.45
isEmptyMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected