/*! * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * \copyright \n * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n * IN PART OR IN WHOLE, \n * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n * * \file maintimer.cpp * \date 2019/09/30 * \author Behrouz NematiPour * */ #include "maintimer.h" //Qt //Project #include "logger.h" #include "filehandler.h" /*! * \brief MainTimer::MainTimer * \details Constructor * \param parent - QObject parent owner object. * Qt handles the children destruction by their parent objects life-cycle. */ MainTimer::MainTimer(QObject *parent) : QObject(parent) { } /*! * \brief MainTimer::init * \details starts the timer ans sets the timer interval * \return */ bool MainTimer::init() { if (gFakeInterval) { startTimer(gFakeInterval); } else { startTimer(_interval); } LOG_EVENT(QObject::tr("Main Timer Initialized")); return true; } /*! * \brief MainTimer::quit * \details Does nothing for now */ void MainTimer::quit() { } /*! * \brief MainTimer::timerEvent * \details This event handler has been re-implemented in here * to receive timer events for the object * for the timer which has been set to _checkInterval * Emits the didTimeout signal on each interval. */ void MainTimer::timerEvent(QTimerEvent *) { emit didTimeout(); }