From dfb55eedae55cfda1166c2780264fa6e31c131c7 Mon Sep 17 00:00:00 2001
From: Burak Hancerli <burak.hancerli@qt.io>
Date: Thu, 31 Oct 2024 08:51:01 +0100
Subject: [PATCH] fix: function invokes

---
 src/backend/backend.cpp | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/src/backend/backend.cpp b/src/backend/backend.cpp
index 7a33911..400b8e1 100644
--- a/src/backend/backend.cpp
+++ b/src/backend/backend.cpp
@@ -147,9 +147,7 @@ void Backend::initDsManager()
             this,
             [this](const QString &id, const QString &ipAddr) {
                 if (id == m_lastProjectSenderId) {
-                    QMetaObject::invokeMethod(m_projectManager.get(),
-                                              "stopProject",
-                                              Qt::QueuedConnection);
+                    QMetaObject::invokeMethod(m_projectManager.get(), "stopProject");
                 }
             });
 
@@ -179,7 +177,6 @@ void Backend::connectDesignStudio(const QString &ipAddr)
 {
     QMetaObject::invokeMethod(m_dsManager.get(),
                               "initDesignStudio",
-                              Qt::QueuedConnection,
                               Q_ARG(QString, ipAddr),
                               Q_ARG(QString, ""));
     emit popupOpen("Connecting in the background...", 1500);
@@ -192,24 +189,17 @@ void Backend::runProject(const QString &id, const QByteArray &projectData)
 
     // we'll use this to notify the correct DS when the project started/stopped
     m_lastProjectSenderId = id;
-    QMetaObject::invokeMethod(m_dsManager.get(),
-                              "sendProjectRunning",
-                              Qt::QueuedConnection,
-                              Q_ARG(QString, id));
+    QMetaObject::invokeMethod(m_dsManager.get(), "sendProjectRunning", Q_ARG(QString, id));
 
     bool retVal;
     QMetaObject::invokeMethod(m_projectManager.get(),
                               "runProject",
-                              Qt::QueuedConnection,
+                              Q_RETURN_ARG(bool, retVal),
                               Q_ARG(QByteArray, projectData),
-                              Q_ARG(bool, autoScaleProject()),
-                              Q_RETURN_ARG(bool, retVal));
+                              Q_ARG(bool, autoScaleProject()));
 
     if (!retVal) {
-        QMetaObject::invokeMethod(m_dsManager.get(),
-                                  "sendProjectStopped",
-                                  Qt::QueuedConnection,
-                                  Q_ARG(QString, id));
+        QMetaObject::invokeMethod(m_dsManager.get(), "sendProjectStopped", Q_ARG(QString, id));
     }
     emit popupClose();
 }
-- 
GitLab