X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2FBusinessLogic%2FEngine.cpp;fp=src%2FBusinessLogic%2FEngine.cpp;h=e46ddc94cb671d4163e076662ff3b7c8d154a42a;hb=663a2fc8ce3a0b8b987655fe709a831a3db9b315;hp=c7aad8b12f81d2c5b750c30661312922f3007f04;hpb=59b4a9d85f3cd02e90c8efcecc66f9150f8a61f8;p=qtmeetings diff --git a/src/BusinessLogic/Engine.cpp b/src/BusinessLogic/Engine.cpp index c7aad8b..e46ddc9 100644 --- a/src/BusinessLogic/Engine.cpp +++ b/src/BusinessLogic/Engine.cpp @@ -53,9 +53,12 @@ Engine::Engine() : // Create auto refresh timer iAutoRefresh = new QTimer; - iAutoRefresh->setInterval(iConfiguration->connectionSettings()->refreshInterval() * 1000); + + iAutoRefresh->setInterval(Configuration::instance()->getRefreshinterval() * 1000); + iAutoRefresh->start(); connect( iAutoRefresh, SIGNAL( timeout() ), iAutoRefresh, SLOT( start() ) ); + connect( iAutoRefresh, SIGNAL( timeout() ), this, SLOT( updateRoomInfo() ) ); // connect( iAutoRefresh, SIGNAL( timeout() ), this, SLOT( fetchMeetings() ) ); if( iDevice->currentOperationMode() == DeviceManager::KioskMode ) @@ -64,7 +67,7 @@ Engine::Engine() : } connectSignals(); - + connect( Configuration::instance(), SIGNAL( configurationChanged() ), this, SLOT( configurationChanged() ) ); // QTimer::singleShot( 0, this, SLOT( fetchMeetings() ) ); // TODO: continue implementation @@ -105,7 +108,6 @@ Room* Engine::defaultRoom() void Engine::checkStatusOfAllRooms() { // TODO: Check if date has changed - // qDebug() << "Engine::checkStatusOfAllRooms()"; // iterate trough on the rooms for (int i = 0; i < iConfiguration->rooms().count(); i++) { @@ -211,7 +213,11 @@ void Engine::errorHandler( int aCode, const QString &aAddInfo ) if( aCode >= 100 && aCode < 150 ) { iCommunicationFailed = true; - if ( iUIManager != 0 ) iUIManager->connectionLost(); + + if ( iUIManager != 0 ) + { + iUIManager->connectionLost(); + } } if ( iWindowManager != 0 ) { @@ -308,7 +314,7 @@ void Engine::connectSignals() void Engine::initCommunication() { // initialize communication - iCommunication = new CommunicationManager( *(iConfiguration->connectionSettings()) ); + iCommunication = new CommunicationManager(/* *(iConfiguration->connectionSettings()) */); connect( iCommunication, SIGNAL( error( int, CommunicationManager::CommunicationType ) ), this, SLOT( errorHandler( int ) ) ); connect( iCommunication, SIGNAL( meetingsFetched( const QList& ) ), @@ -385,4 +391,16 @@ void Engine::tick( QDateTime aCurrentDateTime ) } } iCurrentDate = aCurrentDateTime.date(); -} \ No newline at end of file +} + + +void Engine::updateRoomInfo() +{ + qDebug() << "ENGINE::: updateMeetings"; + roomStatusInfoNeeded(iCurrentRoom); +} + +void Engine::configurationChanged() +{ + iAutoRefresh->setInterval(Configuration::instance()->getRefreshinterval() * 1000); +}