From 76ea7d6cbfb6c257b8f9fdb6486fe768b422773f Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Wed, 26 Jun 2024 11:01:04 +0200
Subject: [PATCH] FitWorker: disambiguate signals

---
 GUI/View/FitControl/FitWorker.cpp         |  6 +++---
 GUI/View/FitControl/FitWorker.h           | 11 +++--------
 GUI/View/FitControl/FitWorkerLauncher.cpp |  8 ++++----
 3 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/GUI/View/FitControl/FitWorker.cpp b/GUI/View/FitControl/FitWorker.cpp
index 805637e15d9..7a911a1cb2d 100644
--- a/GUI/View/FitControl/FitWorker.cpp
+++ b/GUI/View/FitControl/FitWorker.cpp
@@ -17,13 +17,13 @@
 
 void FitWorker::startFit()
 {
-    emit started();
+    emit fit_started();
     try {
         m_fit_objective->runFit();
     } catch (const std::exception& ex) {
-        emit error(QString::fromStdString(ex.what()));
+        emit fit_error(QString::fromStdString(ex.what()));
     }
-    emit finished();
+    emit fit_finished();
 }
 
 void FitWorker::interruptFitting()
diff --git a/GUI/View/FitControl/FitWorker.h b/GUI/View/FitControl/FitWorker.h
index 6cea249073c..9a14ac5da21 100644
--- a/GUI/View/FitControl/FitWorker.h
+++ b/GUI/View/FitControl/FitWorker.h
@@ -26,18 +26,13 @@ public:
     FitWorker(std::shared_ptr<FitObjectiveBuilder> suite) { m_fit_objective = suite; }
 
 public slots:
-
     void startFit();
-
     void interruptFitting();
 
 signals:
-
-    void started();
-
-    void finished();
-
-    void error(const QString& message);
+    void fit_started();
+    void fit_finished();
+    void fit_error(const QString& message);
 
 private:
     std::shared_ptr<FitObjectiveBuilder> m_fit_objective;
diff --git a/GUI/View/FitControl/FitWorkerLauncher.cpp b/GUI/View/FitControl/FitWorkerLauncher.cpp
index 5fc6269c97b..d40033d357b 100644
--- a/GUI/View/FitControl/FitWorkerLauncher.cpp
+++ b/GUI/View/FitControl/FitWorkerLauncher.cpp
@@ -33,16 +33,16 @@ void FitWorkerLauncher::runFitting(std::shared_ptr<FitObjectiveBuilder> suite)
 
     // start fitting when thread starts
     connect(thread, &QThread::started, fw, &FitWorker::startFit);
-    connect(fw, &FitWorker::started, this, &FitWorkerLauncher::intern_workerStarted);
+    connect(fw, &FitWorker::fit_started, this, &FitWorkerLauncher::intern_workerStarted);
 
     connect(this, &FitWorkerLauncher::intern_interruptFittingWorker, fw,
             &FitWorker::interruptFitting, Qt::DirectConnection);
 
-    connect(fw, &FitWorker::error, this, &FitWorkerLauncher::intern_error);
-    connect(fw, &FitWorker::finished, this, &FitWorkerLauncher::intern_workerFinished);
+    connect(fw, &FitWorker::fit_error, this, &FitWorkerLauncher::intern_error);
+    connect(fw, &FitWorker::fit_finished, this, &FitWorkerLauncher::intern_workerFinished);
 
     // delete fitting worker and thread when done
-    connect(fw, &FitWorker::finished, fw, &FitWorker::deleteLater);
+    connect(fw, &FitWorker::fit_finished, fw, &FitWorker::deleteLater);
     connect(thread, &QThread::finished, thread, &QThread::deleteLater);
 
     m_is_fit_running = true;
-- 
GitLab