Fixed errors caused by auto merge that did not work correctly
authorMikko Siren <mikko.siren@ixonos.com>
Mon, 1 Jun 2009 06:35:48 +0000 (09:35 +0300)
committerMikko Siren <mikko.siren@ixonos.com>
Mon, 1 Jun 2009 06:35:48 +0000 (09:35 +0300)
src/BusinessLogic/Engine.cpp
src/BusinessLogic/Engine.h
src/BusinessLogic/UIManager.cpp
src/UserInterface/Views/RoomStatusIndicatorWidget.cpp
src/UserInterface/Views/RoomStatusIndicatorWidget.h

index 962da10..cc021ca 100644 (file)
@@ -164,31 +164,15 @@ void Engine::roomStatusInfoNeeded(Room *aRoom)
        ( ( indexOfNextMeeting != -1 ) ? iMeetings.at( indexOfNextMeeting )->startsAt().time() : Engine::endOfTheDay );
 
        //currently works only for deafult room
-//     if( aRoom->equals( *(defaultRoom() ) ) )
-//             iWindowManager->roomStatusChanged( aRoom, status, until );
-}
-
-/*
-void Engine::fetchMeetings()
-{
-       qDebug() << "Engine::fetchMeetings for " << iCurrentRoom;
-       QDateTime from( iWindowManager->weeklyView()->beginnigOfShownWeek() );
-       QDateTime to( from.addDays( 7 ) );
-       // fetchMeetings( from, to, iWindowManager->weeklyView()->currentRoom() );
-       // Signal is connected to the currentRoomChanged slot which keeps the iCurrentRoom up to date
-       fetchMeetings( from, to, iCurrentRoom );
+       if ( aRoom->equals( *(iCurrentRoom) ) )
+       {
+               emit roomStatusChanged( status, until );
+       }
 }
-*/
 
 void Engine::fetchMeetingDetails( Meeting *aMeeting )
 {
        qDebug() << "Engine::fetchMeetingDetails( Meeting* )";
-/*     iWindowManager->showProgressBar(tr("Please Wait"), true);
-       iWindowManager->updateProgressBar(tr("Fetching Meeting Details...") );
-       connect(iWindowManager, 
-       SIGNAL( progressBarCancelled() ), this, 
-       SLOT( fetchMeetingDetailsCancelled() ));
-       iCommunication->fetchMeetingDetails( *aMeeting); */
        iCommunication->fetchMeetingDetails( *aMeeting );
 }
 
@@ -207,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 )
@@ -236,8 +220,7 @@ 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()
@@ -370,4 +353,5 @@ void Engine::currentRoomChanged(Room *aRoom)
 {
        qDebug() << "[Engine::currentRoomChanged] <invoked>";
        iCurrentRoom = aRoom;
+       roomStatusInfoNeeded( iCurrentRoom );
 }
\ No newline at end of file
index dc538ec..50e5135 100644 (file)
@@ -41,6 +41,8 @@ public:
 
 signals:
 
+       void roomStatusChanged( Room::Status aStatus, QTime aUntil );
+
 private slots:
        //! Slot. Closes the application.
        /*!
@@ -67,12 +69,6 @@ private slots:
         * \param aAddInfo Possible addition info.
         */
        void errorHandler( int aCode, const QString &aAddInfo = "" );
-       //! Slot. Fetches meetings from the server.
-       /*!
-        * Slot. Fetches meetings from the server. Parameters are hard coded: the meetings of the default
-        * room from current and +/- 2 weeks are fetched.
-        */
-//     void fetchMeetings();
        //! Slot. Saves fetched meetings to the current instance's local storage.
        /*!
         * Slot. Saves fetched meetings to the current instance's local storage. Meetings are soted in a
index 7d697e8..2791b15 100644 (file)
@@ -89,7 +89,9 @@ void UIManager::createSettingsView()
 
 void UIManager::createRoomStatusIndicator()
 {
-       iRoomStatusIndicator = new RoomStatusIndicatorWidget( iEngine->defaultRoom(), Room::FreeStatus, QTime::currentTime(), iEngine->iConfiguration->displaySettings()->dateFormat() );
+       iRoomStatusIndicator = new RoomStatusIndicatorWidget( iEngine->defaultRoom(), Room::FreeStatus, QTime::currentTime(), iEngine->iConfiguration->displaySettings()->timeFormat() );
+       connect( iEngine, SIGNAL( roomStatusChanged( Room::Status, QTime ) ), this, SLOT( statusChanged( Room::Status, QTime ) ) );
+       connect( iWeeklyView, SIGNAL( currentRoomChanged( Room * ) ), iRoomStatusIndicator, SLOT( currentRoomChanged( Room * ) ) );
 }
 
 void UIManager::createPasswordDialog()
@@ -237,6 +239,10 @@ void UIManager::updateTime(QDateTime aDateTime)
        {
                iWeeklyView->setCurrentDateTime( aDateTime );
        }
+       if ( iRoomStatusIndicator != 0 )
+       {
+               iRoomStatusIndicator->setCurrentTime( aDateTime.time() );
+       }
 }
 
 void UIManager::passwordEntered( PasswordDialog::PasswordStatus aStatus )
index dbc2b07..26dd09b 100644 (file)
@@ -112,6 +112,7 @@ void RoomStatusIndicatorWidget::setCurrentTime( QTime aCurrentTime )
 \r
 void RoomStatusIndicatorWidget::statusChanged( const Room::Status aStatus, const QTime aUntil )\r
 {\r
+       qDebug() << "[RoomStatusIndicatorWidget::statusChanged] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>";\r
        iStatusLabel->setText( tr( "is %1" ).arg( statusToText( aStatus ) ) );\r
        if ( aUntil == RoomStatusIndicatorWidget::endOfTheDay )\r
        {\r
index 67d40dc..73957b6 100644 (file)
@@ -60,6 +60,8 @@ public slots:
         */\r
        void statusChanged( const Room::Status aStatus, const QTime aUntil );\r
        \r
+       void currentRoomChanged( Room *aRoom );\r
+       \r
        void viewResized(const QSize &newSize, const QSize &oldSize) { }\r
 \r
 private:\r