diff --git a/worker.cpp b/worker.cpp index b453444..549f59f 100644 --- a/worker.cpp +++ b/worker.cpp @@ -158,31 +158,9 @@ Worker::Worker(int customerNr, QDir::setCurrent(m_workingDirectory); m_apismVersion = getAPISMYoctoVersion(); - - this->moveToThread(&m_workerThread); - m_workerThread.start(); - - int cnt = 0; - while (!m_workerThread.isRunning()) { - if (++cnt > 5) { - Utils::printCriticalErrorMsg("starting worker thread FAILED"); - return; - } - QThread::sleep(1); - } } Worker::~Worker() { - int cnt = 0; - m_workerThread.quit(); - while (!m_workerThread.isFinished()) { - if (!m_workerThread.wait(1000)) { - if (++cnt > 5) { - Utils::printCriticalErrorMsg("stopping worker thread FAILED"); - return; - } - } - } } void Worker::displayProgressInMainWindow(int progress) { @@ -207,7 +185,7 @@ void Worker::stopProgressLoop() { } static std::once_flag once; -void Worker::update() { +void Worker::run() { // user should not start the update process several times std::call_once(once, &Worker::privateUpdate, this); }