Index: sources/MainTimer.cpp =================================================================== diff -u -r4a67c01045f365be38f1a12a8572c0070d343e1e -r6c6f1f5d466badd9b4fd67be7c907234c342b2a2 --- sources/MainTimer.cpp (.../MainTimer.cpp) (revision 4a67c01045f365be38f1a12a8572c0070d343e1e) +++ sources/MainTimer.cpp (.../MainTimer.cpp) (revision 6c6f1f5d466badd9b4fd67be7c907234c342b2a2) @@ -1,13 +1,13 @@ /*! * - * Copyright (c) 2020-2022 Diality Inc. - All Rights Reserved. + * Copyright (c) 2020-2023 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file MainTimer.cpp * \author (last) Behrouz NematiPour - * \date (last) 22-Sep-2021 + * \date (last) 28-Sep-2022 * \author (original) Behrouz NematiPour * \date (original) 26-Aug-2020 * @@ -19,7 +19,7 @@ //Project #include "Logger.h" -#include "FileHandler.h" +#include "ApplicationController.h" /*! * \brief MainTimer::MainTimer @@ -42,15 +42,24 @@ if (gFakeInterval) { startTimer(gFakeInterval); } - // disabled coco end - else { - startTimer(_interval); - } + + initConnections(); LOG_DEBUG(tr("%1 Initialized").arg(metaObject()->className())); return true; } /*! + * \brief ApplicationController::initConnections + * \details Initializes the required signal/slot connection between this class and other objects + * to be able to communicate. + */ +void MainTimer::initConnections() +{ + connect(&_ApplicationController , SIGNAL(didKeepAliveBegin()), + this , SLOT( onKeepAliveBegin())); +} + +/*! * \brief MainTimer::quit * \details Does nothing for now */ @@ -107,6 +116,18 @@ } /*! + * \brief MainTimer::onKeepAliveBegin + * \details the handler for the signal didKeepAliveBegin + * comming from ApplicationController + */ +void MainTimer::onKeepAliveBegin() +{ + if ( ! gFakeInterval ) { + startTimer(_interval); + } +} + +/*! * \brief MainTimer::timerEvent * \details This event handler has been re-implemented in here * to receive timer events for the object @@ -115,7 +136,7 @@ */ void MainTimer::timerEvent(QTimerEvent *) { -#ifndef DISABLE_ACKNOW_CHECKIN_MESSAGE_LOG +#ifndef DISABLE_KEEP_ALIVE emit didTimeout(); #endif // I'm not sure how often we need to check for this.