Changes to screen saver mode connection status handling
[qtmeetings] / src / BusinessLogic / Engine.cpp
index 195b0aa..3a5d24f 100644 (file)
@@ -33,6 +33,7 @@ Engine::Engine() :
 {
        qDebug() << "Engine::Engine()";
        iCommunicationFailed = false;
+       iCurrentWeekFetched = false;
        
        initConfiguration();
        initDevice();
@@ -196,10 +197,12 @@ void Engine::fetchMeetingDetails( Meeting *aMeeting )
 void Engine::meetingsFetched( const QList<Meeting*> &aMeetings )
 {
        qDebug() << "Engine::meetingsFetched( const QList<Meeting*> & )";
-       if( iCommunicationFailed )
+       // TODO: should check if this week's meetings were fetched
+       if( iCommunicationFailed || !iCurrentWeekFetched )
        {
+               iCurrentWeekFetched = true;
                iCommunicationFailed = false;
-               iWindowManager->connectionEstablished();
+               iUIManager->connectionEstablished();
        }
 
        for ( int i = 0; i < iMeetings.count(); ++i ) 
@@ -222,8 +225,7 @@ void Engine::errorHandler( int aCode, const QString &aAddInfo )
        if( aCode >= 100 && aCode < 150 )
        {
                iCommunicationFailed = true;
-               //TODO: Call window manager
-               //if ( iWindowManager != 0 ) iWindowManager->connectionLost();
+               if ( iUIManager != 0 ) iUIManager->connectionLost();
        }
        if ( iWindowManager != 0 )
        {
@@ -256,7 +258,6 @@ void Engine::shownWeekChanged( QDate aFrom )
 void Engine::changeDeviceMode( bool aChange )
 {
        if ( aChange )
-       }
        {
                connect( iDevice, SIGNAL( changingModeFailed() ), this, SLOT( changeModeFailed() ) );
                iAutoRefresh->stop(); // Stop the meeting update