aboutsummaryrefslogtreecommitdiff
path: root/launcher/DesktopServices.cpp
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-11-04 18:30:42 +0100
committerSefa Eyeoglu <contact@scrumplex.net>2022-11-04 18:30:42 +0100
commit21a7af535c8b5b9d231aa3c41f7a990689fde560 (patch)
treeaf106527454f91335ec02b17bd36746bf2c3af60 /launcher/DesktopServices.cpp
parenta241d3f187f07cd3049c0d17f711c674fd6e7ccd (diff)
parent8f045af8679e9ae1da120eb56e4cec452284ac56 (diff)
downloadPrismLauncher-21a7af535c8b5b9d231aa3c41f7a990689fde560.tar.gz
PrismLauncher-21a7af535c8b5b9d231aa3c41f7a990689fde560.tar.bz2
PrismLauncher-21a7af535c8b5b9d231aa3c41f7a990689fde560.zip
Merge branch 'develop' into macos-drag-n-drop
Diffstat (limited to 'launcher/DesktopServices.cpp')
-rw-r--r--launcher/DesktopServices.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/launcher/DesktopServices.cpp b/launcher/DesktopServices.cpp
index c29cbe7d..302eaf96 100644
--- a/launcher/DesktopServices.cpp
+++ b/launcher/DesktopServices.cpp
@@ -119,7 +119,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(!APPLICATION->isFlatpak())
+ if(!isFlatpak())
{
return IndirectOpen(f);
}
@@ -140,7 +140,7 @@ bool openFile(const QString &path)
return QDesktopServices::openUrl(QUrl::fromLocalFile(path));
};
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
- if(!APPLICATION->isFlatpak())
+ if(!isFlatpak())
{
return IndirectOpen(f);
}
@@ -158,7 +158,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(!APPLICATION->isFlatpak())
+ if(!isFlatpak())
{
return IndirectOpen([&]()
{
@@ -178,7 +178,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(!APPLICATION->isFlatpak())
+ if(!isFlatpak())
{
// FIXME: the pid here is fake. So if something depends on it, it will likely misbehave
return IndirectOpen([&]()
@@ -203,7 +203,7 @@ bool openUrl(const QUrl &url)
return QDesktopServices::openUrl(url);
};
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
- if(!APPLICATION->isFlatpak())
+ if(!isFlatpak())
{
return IndirectOpen(f);
}
@@ -216,4 +216,13 @@ bool openUrl(const QUrl &url)
#endif
}
+bool isFlatpak()
+{
+#ifdef Q_OS_LINUX
+ return QFile::exists("/.flatpak-info");
+#else
+ return false;
+#endif
+}
+
}