mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
Merge remote-tracking branch 'upstream/staging' into chore/add-compiler-warnings
This commit is contained in:
commit
ef6f9487f4
97 changed files with 2445 additions and 1611 deletions
|
|
@ -118,7 +118,7 @@ bool openDirectory(const QString &path, [[maybe_unused]] bool ensureExists)
|
|||
return QDesktopServices::openUrl(QUrl::fromLocalFile(dir.absolutePath()));
|
||||
};
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
|
||||
if(!isFlatpak())
|
||||
if(!isSandbox())
|
||||
{
|
||||
return IndirectOpen(f);
|
||||
}
|
||||
|
|
@ -139,7 +139,7 @@ bool openFile(const QString &path)
|
|||
return QDesktopServices::openUrl(QUrl::fromLocalFile(path));
|
||||
};
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
|
||||
if(!isFlatpak())
|
||||
if(!isSandbox())
|
||||
{
|
||||
return IndirectOpen(f);
|
||||
}
|
||||
|
|
@ -157,7 +157,7 @@ bool openFile(const QString &application, const QString &path, const QString &wo
|
|||
qDebug() << "Opening file" << path << "using" << application;
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
|
||||
// FIXME: the pid here is fake. So if something depends on it, it will likely misbehave
|
||||
if(!isFlatpak())
|
||||
if(!isSandbox())
|
||||
{
|
||||
return IndirectOpen([&]()
|
||||
{
|
||||
|
|
@ -177,7 +177,7 @@ bool run(const QString &application, const QStringList &args, const QString &wor
|
|||
{
|
||||
qDebug() << "Running" << application << "with args" << args.join(' ');
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
|
||||
if(!isFlatpak())
|
||||
if(!isSandbox())
|
||||
{
|
||||
// FIXME: the pid here is fake. So if something depends on it, it will likely misbehave
|
||||
return IndirectOpen([&]()
|
||||
|
|
@ -202,7 +202,7 @@ bool openUrl(const QUrl &url)
|
|||
return QDesktopServices::openUrl(url);
|
||||
};
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
|
||||
if(!isFlatpak())
|
||||
if(!isSandbox())
|
||||
{
|
||||
return IndirectOpen(f);
|
||||
}
|
||||
|
|
@ -224,4 +224,18 @@ bool isFlatpak()
|
|||
#endif
|
||||
}
|
||||
|
||||
bool isSnap()
|
||||
{
|
||||
#ifdef Q_OS_LINUX
|
||||
return getenv("SNAP");
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool isSandbox()
|
||||
{
|
||||
return isSnap() || isFlatpak();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue