From 6b7c25054dbda08e0dc64b2357d0c3a0efc5b9db Mon Sep 17 00:00:00 2001
From: kkostiuk <kateryna.kostiuk@savoirfairelinux.com>
Date: Sat, 1 Jan 2022 13:42:11 -0500
Subject: [PATCH] instancemanager: disable on macOS

We do not need to verify if an app instance already running
on macOS, because it is done by default. Moreover, it causes a crash
on the macOS app with enabled hardened runtime.

Gitlab: #578
Change-Id: Ic8aa6a136d394372890ed4010f4a3c7ffa8e9233
---
 src/instancemanager.cpp | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/instancemanager.cpp b/src/instancemanager.cpp
index 931218aa7..e6dab5353 100644
--- a/src/instancemanager.cpp
+++ b/src/instancemanager.cpp
@@ -190,6 +190,23 @@ private:
     };
 };
 
+#ifdef Q_OS_MACOS
+InstanceManager::InstanceManager(MainApplication* mainApp)
+    : QObject(mainApp)
+{}
+
+InstanceManager::~InstanceManager() {}
+
+bool
+InstanceManager::tryToRun(const QByteArray& startUri)
+{
+    return true;
+}
+
+void
+InstanceManager::tryToKill()
+{}
+#else
 InstanceManager::InstanceManager(MainApplication* mainApp)
     : QObject(mainApp)
 {
@@ -215,6 +232,7 @@ InstanceManager::tryToKill()
 {
     pimpl_->tryToKill();
 }
+#endif
 
 #include "moc_instancemanager.cpp"
 #include "instancemanager.moc"
-- 
GitLab