aboutsummaryrefslogtreecommitdiff
path: root/launcher/DesktopServices.cpp
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2023-08-02 19:27:48 +0200
committerGitHub <noreply@github.com>2023-08-02 19:27:48 +0200
commitfa2b784f7eb817e97d0af45fe78d205932ada193 (patch)
treef263bdc3fd2f945e6ecc75f9b59b55d009082cca /launcher/DesktopServices.cpp
parentb1aa9e584624a0732dd55fc6c459524a8abfe6ba (diff)
parent01e17806f67534140a6db6cf90191f4db4dd30ac (diff)
downloadPrismLauncher-fa2b784f7eb817e97d0af45fe78d205932ada193.tar.gz
PrismLauncher-fa2b784f7eb817e97d0af45fe78d205932ada193.tar.bz2
PrismLauncher-fa2b784f7eb817e97d0af45fe78d205932ada193.zip
Merge branch 'develop' into sparkle-disable
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
Diffstat (limited to 'launcher/DesktopServices.cpp')
-rw-r--r--launcher/DesktopServices.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/launcher/DesktopServices.cpp b/launcher/DesktopServices.cpp
index 2984a1b4..81362f09 100644
--- a/launcher/DesktopServices.cpp
+++ b/launcher/DesktopServices.cpp
@@ -118,7 +118,7 @@ bool openDirectory(const QString &path, 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();
+}
+
}