0001-Fix-DesktopServices.cpp-to-not-crash-when-using-flat.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. From aa8d71af8ef16b88ebabaae420ccc65dd8fcaab4 Mon Sep 17 00:00:00 2001
  2. From: dada513 <dada513@protonmail.com>
  3. Date: Sat, 1 Jan 2022 02:54:30 +0100
  4. Subject: [PATCH] Fix crash in Flatpak
  5. ---
  6. launcher/DesktopServices.cpp | 20 --------------------
  7. 1 file changed, 20 deletions(-)
  8. diff --git a/launcher/DesktopServices.cpp b/launcher/DesktopServices.cpp
  9. index dcc1b0ce..f754d325 100644
  10. --- a/launcher/DesktopServices.cpp
  11. +++ b/launcher/DesktopServices.cpp
  12. @@ -83,11 +83,7 @@ bool openDirectory(const QString &path, bool ensureExists)
  13. {
  14. return QDesktopServices::openUrl(QUrl::fromLocalFile(dir.absolutePath()));
  15. };
  16. -#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
  17. - return IndirectOpen(f);
  18. -#else
  19. return f();
  20. -#endif
  21. }
  22. bool openFile(const QString &path)
  23. @@ -97,25 +93,13 @@ bool openFile(const QString &path)
  24. {
  25. return QDesktopServices::openUrl(QUrl::fromLocalFile(path));
  26. };
  27. -#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
  28. - return IndirectOpen(f);
  29. -#else
  30. return f();
  31. -#endif
  32. }
  33. bool openFile(const QString &application, const QString &path, const QString &workingDirectory, qint64 *pid)
  34. {
  35. qDebug() << "Opening file" << path << "using" << application;
  36. -#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
  37. - // FIXME: the pid here is fake. So if something depends on it, it will likely misbehave
  38. - return IndirectOpen([&]()
  39. - {
  40. - return QProcess::startDetached(application, QStringList() << path, workingDirectory);
  41. - }, pid);
  42. -#else
  43. return QProcess::startDetached(application, QStringList() << path, workingDirectory, pid);
  44. -#endif
  45. }
  46. bool run(const QString &application, const QStringList &args, const QString &workingDirectory, qint64 *pid)
  47. @@ -139,11 +123,7 @@ bool openUrl(const QUrl &url)
  48. {
  49. return QDesktopServices::openUrl(url);
  50. };
  51. -#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
  52. - return IndirectOpen(f);
  53. -#else
  54. return f();
  55. -#endif
  56. }
  57. }
  58. --
  59. 2.33.1