Fixed errors caused by auto merge that did not work correctly
[qtmeetings] / src / BusinessLogic / Engine.cpp
index d336a3a..cc021ca 100644 (file)
@@ -16,7 +16,7 @@
 #include <QtDebug>
 
 QTime Engine::endOfTheDay = QTime( 23, 59, 0, 0); // end of the day is 11:59pm
-const int IDLE_TIME_MULTIPLIER = 5000; // Multiplies milliseconds to minutes
+const int IDLE_TIME_MULTIPLIER = 60000; // Multiplies milliseconds to minutes
 
 // Macro to help deleting objects. This could be global.
 #define QT_DELETE(X) \
@@ -191,7 +191,7 @@ void Engine::meetingsFetched( const QList<Meeting*> &aMeetings )
        }
 
        // refresh room status info
-       roomStatusInfoNeeded( defaultRoom() );
+       roomStatusInfoNeeded( iCurrentRoom /*defaultRoom()*/ );
 }
 
 void Engine::errorHandler( int aCode, const QString &aAddInfo )
@@ -220,24 +220,19 @@ void Engine::shownWeekChanged( QDate aFrom )
        QDateTime from( aFrom );
        QDateTime to( aFrom.addDays( 7 ), QTime( 23, 59 ) );
        qDebug() << "[Engine::shownWeekChanged] <From " << aFrom.toString( "d.m. h:mm" ) << " to " << to.toString( "d.m. h:mm" ) << ">";
-       iCommunication->fetchMeetings( from, to, *defaultRoom() );
-//     fetchMeetings( from, to, iWindowManager->weeklyView()->currentRoom() );
+       iCommunication->fetchMeetings( from, to, *iCurrentRoom/*defaultRoom()*/ );
 }
 
-void Engine::changeDeviceMode( bool aChange )
+void Engine::changeDeviceMode()
 {
-       if ( aChange )
-       {
-               connect( iDevice, SIGNAL( changingModeFailed() ), this, SLOT( changeModeFailed() ) );
-               iAutoRefresh->stop(); // Stop the meeting update
-       }
-       iDevice->changeMode( aChange );
+       connect( iDevice, SIGNAL( changeModeFailed() ), this, SLOT( changeModeFailed() ) );
+       iAutoRefresh->stop(); // Stop the meeting update
+       iDevice->changeMode();
 }
 
 void Engine::changeModeFailed()
 {
        qDebug() << "Engine::progressBarCancelled()";
-       iDevice->changeMode( false );
        iAutoRefresh->start(); //we start the metting updating
 }
 
@@ -252,7 +247,7 @@ void Engine::initUserInterface()
        
        connect( iWindowManager, SIGNAL( eventDetected() ), this, SLOT( handleViewEvent() ) );
        connect( iWindowManager, SIGNAL( previousViewRestored() ), iUIManager, SLOT( previousViewRestored() ) );
-//     connect( iWindowManager, SIGNAL( dialogActivated() ), this, SLOT( dialogActivated() ) );
+       connect( iWindowManager, SIGNAL( dialogActivated() ), this, SLOT( dialogActivated() ) );
        connect( iWindowManager, SIGNAL( dialogDeactivated() ), this, SLOT( dialogDeactivated() ) );
        
        // Show the UI
@@ -268,7 +263,7 @@ void Engine::initUserInterface()
 
 void Engine::handleViewEvent()
 {
-       if ( iIdleTimeCounter != 0 )
+       if ( iIdleTimeCounter != 0 && iIdleTimeCounter->isActive())
        {
                // Restart the idle time counter when view event is received
                iIdleTimeCounter->stop();
@@ -358,4 +353,5 @@ void Engine::currentRoomChanged(Room *aRoom)
 {
        qDebug() << "[Engine::currentRoomChanged] <invoked>";
        iCurrentRoom = aRoom;
+       roomStatusInfoNeeded( iCurrentRoom );
 }
\ No newline at end of file