Commit e185f585 authored by Kevin Whitaker's avatar Kevin Whitaker
Browse files

flatpak: Fix looking up user installed SDKs

Look the SDK up first in the user installation then the system's.
parent 33eff1ac
Pipeline #111598 passed with stage
in 33 minutes and 6 seconds
......@@ -73,7 +73,11 @@ void FlatpakRuntime::refreshJson()
const QString runtimeVersion = doc.value(QLatin1String("runtime-version")).toString();
const QString usedRuntime = sdkName + QLatin1Char('/') + m_arch + QLatin1Char('/') + runtimeVersion;
m_sdkPath = KDevelop::Path(QLatin1String("/var/lib/flatpak/runtime/") + usedRuntime + QLatin1String("/active/files"));
//First check if local user has flatpak runtime before checking system runtimes.
m_sdkPath = KDevelop::Path(QDir::homePath() + QLatin1String("/.local/share/flatpak/runtime/") + usedRuntime + QLatin1String("/active/files"));
if(!QFile::exists(m_sdkPath.toLocalFile())) {
m_sdkPath = KDevelop::Path(QLatin1String("/var/lib/flatpak/runtime/") + usedRuntime + QLatin1String("/active/files"));
}
qCDebug(FLATPAK) << "flatpak runtime path..." << name() << m_sdkPath;
Q_ASSERT(QFile::exists(m_sdkPath.toLocalFile()));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment