Index: sources/ApplicationController.cpp =================================================================== diff -u -rc9f8f8cf3c6c37fc6460d8675c62c9442c4d4263 -rc73feffa73c7fe073a7a7581144f5806dfc91beb --- sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision c9f8f8cf3c6c37fc6460d8675c62c9442c4d4263) +++ sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision c73feffa73c7fe073a7a7581144f5806dfc91beb) @@ -146,9 +146,6 @@ connect(&_Logger , SIGNAL(didExportStat (quint32, const QString &, quint8)), this , SLOT( onExportStat (quint32, const QString &, quint8))); - // Settings - move to application thread - connect(this, SIGNAL(didSettingsInit()), - this, SLOT( onSettingsInit())); connect(&_settingsWatcher, SIGNAL(finished ()), this , SLOT(onSettingsUpdate())); @@ -502,31 +499,29 @@ } // disabled coco end + +void ApplicationController::postDoneRequest() +{ + AdjustUIPostFinalResultRequestData data; + data.mResult = _post.isDone(); + emit didAdjustment(data); +} + /*! * \brief ApplicationController::initSettings * \details The external method available to request for initializing the settings * To start the task in Application Tread, emits a signal which will call a slot to take care of the execution. */ void ApplicationController::initSettings() { - // this emit guaranties that the slot will be called in the application thread - // also the signal is private so it will be used internally only. - emit didSettingsInit({}); -} - -/*! - * \brief ApplicationController::onSettingsInit - * \details The slot which will be called to start the settings initialization in Application thread. - * This method also initializes the Settings model singleton object to let it live in the Application thread. - * To start the setting initialization QConcurrent is used with QFuture to signal the Application when it's done. - */ -void ApplicationController::onSettingsInit() -{ // That is enough to call to the I function here to create the object in the thread that Settings is leaving in, // which currently is Application_Thread, since the Settings is created in that thread. _Settings; - QFuture mFuture = QtConcurrent::run(this, &ApplicationController::settingsInit); + QFuture mFuture = QtConcurrent::run([=](){ // made the call a lambda to make sure there is no function to accidentally being called, out of thread [developer safety]. + Storage::Settings settings; + settings.read(); + }); _settingsWatcher.setFuture(mFuture); } @@ -543,6 +538,8 @@ _Settings.datetimeFormat(); emit didSettingsDone(); + + emit didPOSTPass(_post.isDone()); } /*! @@ -594,11 +591,12 @@ * \details Sends the POST Final message */ void ApplicationController::onPOSTDone(bool vPass) { - AdjustUIPostFinalResultRequestData data; - data.mResult = vPass; - emit didAdjustment(data); - LOG_DEBUG("ApplicationPost Done"); + LOG_DEBUG("ApplicationPOST Done"); + initSettings(); + + postDoneRequest(); + versionsRequest(vPass); } @@ -616,17 +614,6 @@ } /*! - * \brief ApplicationController::settingsInit - * \details The Settings read function is called in this method. - * This callback function for the QCuncurrnent run. - */ -void ApplicationController::settingsInit() -{ - Storage::Settings settings; - settings.read(); -} - -/*! * \brief ApplicationController::onstartPOST * \details The POST entry point * - Sends the first async check-in to the HD to let HD know it can start it's POST and UI is ready to communicate.