summaryrefslogtreecommitdiffstats
path: root/games/multimc/files/patch-launcher_DesktopServices.cpp
blob: 0bc36b682415e4933a8bb1f2e7fba904f35f7937 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
--- launcher/DesktopServices.cpp.orig	2021-09-08 22:27:46 UTC
+++ launcher/DesktopServices.cpp
@@ -7,7 +7,7 @@
 /**
  * This shouldn't exist, but until QTBUG-9328 and other unreported bugs are fixed, it needs to be a thing.
  */
-#if defined(Q_OS_LINUX)
+#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
 
 #include <unistd.h>
 #include <errno.h>
@@ -83,7 +83,7 @@ bool openDirectory(const QString &path, bool ensureExi
     {
         return QDesktopServices::openUrl(QUrl::fromLocalFile(dir.absolutePath()));
     };
-#if defined(Q_OS_LINUX)
+#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
     return IndirectOpen(f);
 #else
     return f();
@@ -97,7 +97,7 @@ bool openFile(const QString &path)
     {
         return QDesktopServices::openUrl(QUrl::fromLocalFile(path));
     };
-#if defined(Q_OS_LINUX)
+#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
     return IndirectOpen(f);
 #else
     return f();
@@ -107,7 +107,7 @@ bool openFile(const QString &path)
 bool openFile(const QString &application, const QString &path, const QString &workingDirectory, qint64 *pid)
 {
     qDebug() << "Opening file" << path << "using" << application;
-#if defined(Q_OS_LINUX)
+#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
     return IndirectOpen([&]()
     {
@@ -121,7 +121,7 @@ bool openFile(const QString &application, const QStrin
 bool run(const QString &application, const QStringList &args, const QString &workingDirectory, qint64 *pid)
 {
     qDebug() << "Running" << application << "with args" << args.join(' ');
-#if defined(Q_OS_LINUX)
+#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
     return IndirectOpen([&]()
     {
@@ -139,7 +139,7 @@ bool openUrl(const QUrl &url)
     {
         return QDesktopServices::openUrl(url);
     };
-#if defined(Q_OS_LINUX)
+#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
     return IndirectOpen(f);
 #else
     return f();