From: Jan Lapinkataja Date: Wed, 27 May 2009 12:46:20 +0000 (+0300) Subject: Merge finished X-Git-Url: http://git.maemo.org/git/?p=qtmeetings;a=commitdiff_plain;h=60b7802da53961d1998e276858bbc5e404b98a05 Merge finished --- diff --git a/src/BusinessLogic/Engine.cpp b/src/BusinessLogic/Engine.cpp index 104bbdf..dc62dc3 100644 --- a/src/BusinessLogic/Engine.cpp +++ b/src/BusinessLogic/Engine.cpp @@ -103,15 +103,11 @@ void Engine::closeApplication() void Engine::observedEventDetected() { qDebug() << "Engine::observedEventDetected()"; -<<<<<<< HEAD:src/BusinessLogic/Engine.cpp - iWindowManager->refreshMeetings( iMeetings ); -======= if ( !iIdleTimeCounter->isActive() ) { iWindowManager->weeklyView()->showCurrentWeek(); } iWindowManager->showWeeklyView(); ->>>>>>> 56f763c68a2ff56d344ef150b7378ca417d08b36:src/BusinessLogic/Engine.cpp // prepare to restart idle counter if (iIdleTimeCounter->isActive() ) { @@ -215,7 +211,6 @@ void Engine::fetchMeetingDetails(Meeting *aMeeting) iCommunication->fetchMeetingDetails( *aMeeting); } -<<<<<<< HEAD:src/BusinessLogic/Engine.cpp void Engine::meetingsFetched( const QList &aMeetings ) { qDebug() << "Engine::meetingsFetched( const QList & )"; @@ -228,51 +223,6 @@ void Engine::meetingsFetched( const QList &aMeetings ) for ( int i = 0; i < aMeetings.count(); ++i ) { Meeting* m = new Meeting( *(aMeetings.at( i )) ); iMeetings.append( m ); -======= -bool Engine::isMeetingInList(const QList &aList, const Meeting *aMeeting) -{ - qDebug() - << "Engine::isMeetingInList( const QList &, const Meeting * )"; - for (int i = 0; i < aList.count(); i++) - { - if (aMeeting->equals( *(aList.at(i))) ) - { - return true; - } - } - return false; -} - -void Engine::meetingsFetched(const QList &aMeetings) -{ - qDebug() << "Engine::meetingsFetched( const QList & )"; - // check if there is any new meeting in the list came from the server -> added - for (int i = 0; i < aMeetings.count(); i++) - { - // if the (i)th meeting is not in the local meeting list - if ( !isMeetingInList(iMeetings, aMeetings.at(i) ) ) - { - // add to the local database =) - Meeting* m = new Meeting( *(aMeetings.at( i )) ); - iMeetings.append(m); - // and signal the changes - iWindowManager->insertMeeting(m); - } - } - - // check if there is any meeting NOT in the list came from the server -> deleted - for (int i = 0; i < iMeetings.count(); i++) - { - // if the (i)th meeting is in the local but NOT in the server's meeting list - if ( !isMeetingInList(aMeetings, iMeetings.at(i) ) ) - { - Meeting* m = iMeetings.takeAt(i); - // signal the changes - iWindowManager->deleteMeeting(m); - // delete the meeting from the local list - delete m; - } ->>>>>>> 56f763c68a2ff56d344ef150b7378ca417d08b36:src/BusinessLogic/Engine.cpp } iWindowManager->refreshMeetings( iMeetings ); @@ -376,3 +326,4 @@ void Engine::fetchMeetingDetailsCancelled() iCommunication->cancelFetchMeetingDetails(); iWindowManager->closeProgressBar(); } +