Changeset View
Changeset View
Standalone View
Standalone View
plugins/flatpak/flatpakruntime.cpp
Show First 20 Lines • Show All 224 Lines • ▼ Show 20 Line(s) | 223 | if (bdfiles.isParentOf(localPath)) { | |||
---|---|---|---|---|---|
225 | ret = Path(Path(QStringLiteral("/app")), relpath); | 225 | ret = Path(Path(QStringLiteral("/app")), relpath); | ||
226 | } | 226 | } | ||
227 | } | 227 | } | ||
228 | 228 | | |||
229 | qCDebug(FLATPAK) << "path in runtime" << localPath << ret; | 229 | qCDebug(FLATPAK) << "path in runtime" << localPath << ret; | ||
230 | return ret; | 230 | return ret; | ||
231 | } | 231 | } | ||
232 | 232 | | |||
233 | QString FlatpakRuntime::findExecutable(const QString& executableName) const | ||||
234 | { | ||||
235 | QStringList rtPaths; | ||||
mwolff: dito | |||||
236 | | ||||
237 | auto envPaths = getenv(QByteArrayLiteral("PATH")).split(':'); | ||||
238 | std::transform(envPaths.begin(), envPaths.end(), std::back_inserter(rtPaths), | ||||
239 | [this](QByteArray p) { | ||||
240 | return pathInHost(Path(QString::fromLocal8Bit(p))).toLocalFile(); | ||||
241 | }); | ||||
242 | | ||||
243 | return QStandardPaths::findExecutable(executableName, rtPaths); | ||||
244 | } | ||||
245 | | ||||
233 | QByteArray FlatpakRuntime::getenv(const QByteArray& varname) const | 246 | QByteArray FlatpakRuntime::getenv(const QByteArray& varname) const | ||
234 | { | 247 | { | ||
235 | if (varname == "KDEV_DEFAULT_INSTALL_PREFIX") | 248 | if (varname == "KDEV_DEFAULT_INSTALL_PREFIX") | ||
236 | return "/app"; | 249 | return "/app"; | ||
237 | return qgetenv(varname.constData()); | 250 | return qgetenv(varname.constData()); | ||
238 | } | 251 | } | ||
239 | 252 | | |||
240 | KDevelop::Path FlatpakRuntime::buildPath() const | 253 | KDevelop::Path FlatpakRuntime::buildPath() const | ||
241 | { | 254 | { | ||
242 | auto file = m_file; | 255 | auto file = m_file; | ||
243 | file.setLastPathSegment(QStringLiteral(".flatpak-builder")); | 256 | file.setLastPathSegment(QStringLiteral(".flatpak-builder")); | ||
244 | file.addPath(QStringLiteral("kdevelop")); | 257 | file.addPath(QStringLiteral("kdevelop")); | ||
245 | return file; | 258 | return file; | ||
246 | } | 259 | } |
dito