X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2FBusinessLogic%2FEngine.cpp;h=911b49bb16ff37bbe85b16d301c637094341d067;hb=100bffcd0e9a9a967be6da8e9977da3d94dc606a;hp=25c30483fdd3c1c718d66a4e0ba75eff7d24a4b6;hpb=658e4917f437e1f3bb214466ae91dc8fa0ea4705;p=qtmeetings diff --git a/src/BusinessLogic/Engine.cpp b/src/BusinessLogic/Engine.cpp index 25c3048..911b49b 100644 --- a/src/BusinessLogic/Engine.cpp +++ b/src/BusinessLogic/Engine.cpp @@ -22,6 +22,7 @@ Engine::Engine() : iClock( 0 ), iConfiguration( Configuration::instance() ), iCommunication( 0 ) { qDebug() << "Engine::Engine()"; + iCommunicationFailed = false; // if reading of configuration fails, signal that initialization failed if ( iConfiguration == 0 ) { @@ -233,6 +234,12 @@ bool Engine::isMeetingInList( const QList &aList, const Meeting *aMeet void Engine::meetingsFetched( const QList &aMeetings ) { qDebug() << "Engine::meetingsFetched( const QList & )"; + if( iCommunicationFailed ) + { + iCommunicationFailed = false; + //iWindowManager->connectionEstablished(); + } + // check if there is any new meeting in the list came from the server -> added for ( int i = 0; i < aMeetings.count(); i++ ) { @@ -269,6 +276,11 @@ void Engine::meetingDetailsFetched( Meeting &aDetailedMeeting ) { qDebug() << "Engine::meetingDetailsFetched( Meeting & )"; iWindowManager->closeProgressBar(); + if( iCommunicationFailed ) + { + iCommunicationFailed = false; + iWindowManager->connectionEstablished(); + } iWindowManager->showMeetingInfo( &aDetailedMeeting ); } @@ -277,8 +289,16 @@ void Engine::errorHandler( int aCode, const QString &aAddInfo ) qDebug() << "Engine::ErrorHandler, aCode: " << aCode; // inform UI about the problem if( aCode >= 100 && aCode <= 150 ) { //communication errors + { //we don't want these to close operation changing qDebug() << "CommunicationManager signaled an error:" << aCode; + if( !iCommunicationFailed ) + { + // Only inform window manager when first error appears + iCommunicationFailed = true; + //iWindowManager->connectionLost(); + } + } iWindowManager->closeProgressBar(); } iWindowManager->error( ErrorMapper::codeToString( aCode, aAddInfo ) );