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() )
{
iCommunication->fetchMeetingDetails( *aMeeting);
}
-<<<<<<< HEAD:src/BusinessLogic/Engine.cpp
void Engine::meetingsFetched( const QList<Meeting*> &aMeetings )
{
qDebug() << "Engine::meetingsFetched( const QList<Meeting*> & )";
for ( int i = 0; i < aMeetings.count(); ++i ) {
Meeting* m = new Meeting( *(aMeetings.at( i )) );
iMeetings.append( m );
-=======
-bool Engine::isMeetingInList(const QList<Meeting*> &aList, const Meeting *aMeeting)
-{
- qDebug()
- << "Engine::isMeetingInList( const QList<Meeting*> &, 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<Meeting*> &aMeetings)
-{
- qDebug() << "Engine::meetingsFetched( const QList<Meeting*> & )";
- // 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 );
iCommunication->cancelFetchMeetingDetails();
iWindowManager->closeProgressBar();
}
+