Merge branch 'master' into dev_local
authorZoltan Papp <zoltan.papp@ixonos.com>
Mon, 1 Jun 2009 06:14:56 +0000 (09:14 +0300)
committerZoltan Papp <zoltan.papp@ixonos.com>
Mon, 1 Jun 2009 06:14:56 +0000 (09:14 +0300)
Conflicts:
src/BusinessLogic/UIManager.h

14 files changed:
QtMeetings.conf
QtMeetings.pro
resources/xml/errortable.xml
src/BusinessLogic/Engine.cpp
src/BusinessLogic/UIManager.cpp
src/BusinessLogic/UIManager.h
src/Domain/Configuration/Configuration.cpp
src/Domain/Configuration/Configuration.h
src/Domain/Configuration/DateTimeSettings.cpp [new file with mode: 0644]
src/Domain/Configuration/DateTimeSettings.h [new file with mode: 0644]
src/IO/Communication/CommunicationManager.cpp
src/IO/Communication/MessagingUtils.cpp
src/UserInterface/Views/RoomStatusIndicatorWidget.cpp
src/UserInterface/Views/ViewBase.cpp

index 7066087..04cb472 100644 (file)
                        <name>Hercules</name>
                        <address>meetingroom.hercules@ixonos.com</address>
                </room>
-       </rooms>
+    </rooms>
+
+    <daylight_saving_time>
+               <!-- Sunday = 0, Monday = 1, Tuesday = 2 etc.. -->
+               <DayOfWeek>0</DayOfWeek>
+               <!-- date/time format is dd.MM.yyyy hh:mm:ss  -->
+               <StandardTimeChangeMoment>05.10.2009 03:00:00</StandardTimeChangeMoment>
+               <DaylightSaveTimeChangeMoment>01.04.2010 03:00:00</DaylightSaveTimeChangeMoment>
+    </daylight_saving_time>
+       
 
        <!-- language code must be in ISO 3166-1 alpha-2 standard -->
        <language code="EN" />
index 121575b..b4c6c65 100644 (file)
@@ -21,6 +21,7 @@ HEADERS += src/BusinessLogic/UIManager.h \
     src/Domain/Configuration/ConnectionSettings.h \
     src/Domain/Configuration/StartupSettings.h \
     src/Domain/Configuration/DisplaySettings.h \
+    src/Domain/Configuration/DateTimeSettings.h \
     src/Domain/Configuration/Configuration.h \
     src/IO/Communication/MessagingUtils.h \
     src/IO/Communication/Communication.h \
@@ -55,6 +56,7 @@ SOURCES += src/BusinessLogic/UIManager.cpp \
     src/Domain/Configuration/ConnectionSettings.cpp \
     src/Domain/Configuration/StartupSettings.cpp \
     src/Domain/Configuration/DisplaySettings.cpp \
+    src/Domain/Configuration/DateTimeSettings.cpp \
     src/Domain/Configuration/Configuration.cpp \
     src/IO/Communication/MessagingUtils.cpp \
     src/IO/Communication/Communication.cpp \
index 4706fce..841228a 100644 (file)
     <error code="110">Communication error</error>
     <error code="111">Communication: Invalid username or password</error>
     <error code="200">Device Control: Error creating internal file storage.</error>
-    <error code="201">Failed to change the operation mode. Error removing old alarm events.</error>
-       <error code="202">Failed to change the operation mode. Error sending alarm events. %1</error>
-       <error code="203">Failed to change the operation mode. Error storing data about sent alarm events. Removing the already sent alarm events.</error>
-       <error code="204">Error storing data of original automatic screen switching-off and dimming parameter values. Using the default values instead.</error>
-       <error code="205">Error fetching data of original automatic screen switching-off and dimming parameter values. Using the default values instead.</error>
-       <error code="206">Failed to change the operation mode. Error changing automatic screen switching-off and dimming parameter values.</error>
-       <error code="207">Failed to change the operation mode. Error fetching data of original hardware key settings.</error>
-       <error code="208">Failed to change the operation mode. Error storing data of original hardware key settings.</error>
-       <error code="209">Failed to change the operation mode. Error changing hardware key settings.</error>
-       <error code="210">Failed to change the operation mode. Init script to auto launch the application was not installed/removed.</error>
-       <error code="211">Failed to change the operation mode. The application failed to know the current mode of itself.</error>
-       <error code="212">Failed to change the operation mode. The application failed to store the current mode of itself.</error>
-       <error code="213">Failed to change the operation mode. Error restarting the device. Restart device manually.</error>
+    <error code="201">Device Control: Error removing old alarm events.</error>
+       <error code="202">Device Control: Error sending alarm events. %1</error>
+       <error code="203">Device Control: Error storing data about sent alarm events. Removing the already sent alarm events.</error>
+       <error code="204">Device Control: Error storing data of original automatic screen switching-off and dimming parameter values. Used the default values instead.</error>
+       <error code="205">Device Control: Error fetching data of original automatic screen switching-off and dimming parameter values. Used the default values instead.</error>
+       <error code="206">Device Control: Error changing automatic screen switching-off and dimming parameter values.</error>
+       <error code="207">Device Control: Error fetching data of original hardware key settings.</error>
+       <error code="208">Device Control: Error storing data of original hardware key settings.</error>
+       <error code="209">Device Control: Error changing hardware key settings.</error>
+       <error code="210">Device Control: Init script to auto launch the application was not installed/removed.</error>
+       <error code="211">Device Control: The application failed to know the current mode of itself.</error>
+       <error code="212">Device Control: The application failed to store the current mode of itself.</error>
+       <error code="213">Device Control: Error restarting the device. Restart device manually to activate operation mode change.</error>
 </errors>
index 3a5d24f..3ef75cb 100644 (file)
@@ -283,14 +283,17 @@ 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( dialogDeactivated() ), this, SLOT( dialogDeactivated() ) );
+//     connect( iWindowManager, SIGNAL( dialogActivated() ), this, SLOT( dialogActivated() ) );
+//     connect( iWindowManager, SIGNAL( dialogDeactivated() ), this, SLOT( dialogDeactivated() ) );
        
        // Show the UI
        iWindowManager->setWindowState( Qt::WindowMaximized );
        iWindowManager->show();
        iUIManager->showMainView();
        
+       // This triggers the meeting fetching
+       iUIManager->currentRoomChanged( this->iCurrentRoom );
+       
        qDebug() << "[Engine::initUserInterface] <Finished>";
 }
 
@@ -384,5 +387,6 @@ void Engine::startIdleTimeCounter()
 
 void Engine::currentRoomChanged(Room *aRoom)
 {
+       qDebug() << "[Engine::currentRoomChanged] <invoked>";
        iCurrentRoom = aRoom;
 }
\ No newline at end of file
index a540f96..1c8345b 100644 (file)
@@ -37,16 +37,12 @@ UIManager::UIManager( Engine *aEngine, WindowManager *aWindowManager ) :
        if ( iEngine == 0 ) return;
        if ( iWindowManager == 0 ) return;
        
-       qDebug() << "[UIManager::ctor] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>";
-       
        createWeeklyView();
        createSettingsView();
        createRoomStatusIndicator();
        createPasswordDialog();
        createProgressBar();
        createMeetingInfoDialog();
-       
-       qDebug() << "[UIManager::ctor] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>";
 }
 
 UIManager::~UIManager()
@@ -255,6 +251,7 @@ void UIManager::connectionEstablished()
 
 void UIManager::currentRoomChanged(Room *aRoom)
 {
+       qDebug() << "[UIManager::currentRoomChanged] <Invoked>";
        if ( iWeeklyView != 0 )
        {
                QDateTime from = QDateTime( iWeeklyView->beginnigOfShownWeek() );
index 6721510..8d47f86 100644 (file)
@@ -18,6 +18,15 @@ class MeetingInfoDialog;
 class CommunicationManager;
 class QDateTime;
 
+//! User Interface manager class.
+/*!
+ * User Interface manager class that is responsible for handling
+ * UI actions. It creates the needed views and connects signals
+ * accordingly. All interactions with the UI is handled by this
+ * class. The Engine class handles the basic logic and does not
+ * know or care about the UI and this class does not know or care
+ * about the basic logic only UI related actions (signals, events etc.).
+ */
 class UIManager : public QObject
 {
        Q_OBJECT
@@ -26,20 +35,73 @@ public:
        UIManager( Engine *aEngine, WindowManager *aWindowManager );
        virtual ~UIManager();
        
+       //! Connects Device Managers signals.
+       /*!
+        * This method connects Device Managers signals directly to UI
+        * components or to it selft.
+        */
        void connectDeviceManager( DeviceManager *aDeviceManager );
+       //! Connects Communication Managers signals.
+       /*!
+        * This method connects Communication Managers signals directly to UI
+        * components or to it selft.
+        */
        void connectCommunicationManager( CommunicationManager *aCommunicationManager );
+       //! Shows the main view.
+       /*!
+        * Makes the main view visible trough WindowManager.
+        */
        void showMainView();
+       //! Shows the progress bar.
+       /*!
+        * Shows the progress bar with given text.
+        */
        void showProgressBar( QString aText );
 
 signals:
        
 public slots:
 
+       //! Handles setting view request.
+       /*!
+        * Handles request to show settings view. Makes the
+        * view visible and stops the idle time counter.
+        */
        void settingsViewRequest();
+       //! Handles setting views ok clicked.
+       /*!
+        * Handles the setting views Ok button clicked
+        * signal. Sets the weekly view visible and starts
+        * the idle time counter.
+        */
        void settingsOkClicked();
+       //! Handles room status indicator view request.
+       /*!
+        * Handles the request to show room status indicator
+        * view. Sets the view visible and stops the idle
+        * time counter. The WindowManager handles restoring
+        * what ever view was previously visible.
+        */
        void roomStatusIndicatorRequested();
+       //! Handles previousViewRestored signal.
+       /*!
+        * Handles the restoring of previous view. This is usually
+        * signaled by WindowManager when room status indicator
+        * view is being hidden.
+        */
        void previousViewRestored();
+       //! Handle change mode order.
+       /*!
+        * Handles change mode order. Displays the password query dialog
+        * and waits for its response.
+        */
        void changeModeOrdered( DeviceManager::OperationMode aMode );
+       //! Handles select room change.
+       /*!
+        * Handles the changing of currently select room. Engine is requested
+        * to start fetching new meetings for currently shown week.
+        */
+       void currentRoomChanged( Room *aRoom );
 
        //! Shows any view specific indicators for connection error
        void connectionLost();
@@ -47,11 +109,11 @@ public slots:
        //! Removes any view specific indicators for connection error
        void connectionEstablished();
        
+       
 private slots:
 
        void meetingsFetched( const QList<Meeting*> &aMeetings );
        void meetingDetailsFetched( Meeting &aDetailedMeeting );
-       void currentRoomChanged( Room *aRoom );
        void progressBarCancelled();
        void updateTime( QDateTime aDateTime );
        void passwordEntered( PasswordDialog::PasswordStatus aStatus );
index 56a4472..0076e23 100644 (file)
@@ -2,6 +2,7 @@
 #include "ConnectionSettings.h"
 #include "StartupSettings.h"
 #include "DisplaySettings.h"
+#include "DateTimeSettings.h"
 #include "Room.h"
 #include <QDomDocument>
 #include <QDomElement>
@@ -17,7 +18,8 @@ QString Configuration::sConfigurationPath = "/etc/QtMeetings.conf";
 Configuration::Configuration() :
                iConnectionSettings( 0 ),
                iStartupSettings( 0 ),
-               iDisplaySettings( 0 )
+               iDisplaySettings( 0 ),
+               iDateTimeSettings( 0 )
 {
 }
 
@@ -26,6 +28,7 @@ Configuration::~Configuration()
        delete iConnectionSettings;
        delete iStartupSettings;
        delete iDisplaySettings;
+       delete iDateTimeSettings;
        while ( !iRooms.isEmpty() )
        {
                delete iRooms.takeFirst();
@@ -60,6 +63,11 @@ DisplaySettings * Configuration::displaySettings()
        return iDisplaySettings;
 }
 
+DateTimeSettings * Configuration::dateTimeSettings()
+{
+       return iDateTimeSettings;
+}
+
 Room* Configuration::defaultRoom()
 {
        // default room is stored as the first element of the list
@@ -127,6 +135,10 @@ void Configuration::save()
                {
                        saveDisplaySettings( node );
                }
+               else if (tagName == QString( "daylight_saving_time" ) )
+               {
+                       saveDateTimeSettings( node );
+               }
        }
 
        //! Empty the file from previous content and write again with new one
@@ -281,6 +293,31 @@ void Configuration::saveDisplaySettings( const QDomNode &aXML )
        }
 }
 
+void Configuration::saveDateTimeSettings( const QDomNode &aXML )
+{
+       for ( QDomNode node = aXML.firstChild(); !node.isNull(); node = node.nextSibling() )
+       {
+               QDomElement e = node.toElement();
+               QString tagName = e.tagName().toLower();
+
+               if ( tagName == QString( "dayofweek" ) )
+               {
+                       QDomText t = node.ownerDocument().createTextNode( iDateTimeSettings->switchDay() );
+                       e.replaceChild( t, e.firstChild() );
+               }
+               else if( tagName == QString( "StandardTimeChangeMoment" ) )
+               {
+                       QDomText t = node.ownerDocument().createTextNode( iDateTimeSettings->STDDateTime().toString("ddMMyyyyhhmmss"));
+                       e.replaceChild( t, e.firstChild() );
+               }
+               else if( tagName == QString( "DaylightSaveTimeChangeMoment" ) )
+               {
+                       QDomText t = node.ownerDocument().createTextNode( iDateTimeSettings->DSTDateTime().toString("ddMMyyyyhhmmss"));
+                       e.replaceChild( t, e.firstChild() );
+               }
+       }
+}
+
 void Configuration::saveAdminPassword( const QDomNode &aXML )
 {
        QDomElement e = aXML.toElement();
@@ -340,6 +377,10 @@ Configuration* Configuration::readFromXML( const QString &aPath )
                {
                        conf->iDisplaySettings = Configuration::readDisplaySettings( node );
                }
+               else if ( tagName == QString( "daylight_saving_time" ) )
+               {
+                       conf->iDateTimeSettings = Configuration::readDateTimeSettings(node);
+               }
        }
 
        return conf;
@@ -560,6 +601,44 @@ DisplaySettings * Configuration::readDisplaySettings( const QDomNode &aXML )
        return new DisplaySettings( dateformat, timeformat, daysInSchedule, dayStartsAt, dayEndsAt, screensaver );
 }
 
+DateTimeSettings * Configuration::readDateTimeSettings( const QDomNode &aXML )
+{
+       // Set defaults..
+       QDateTime standardTimeChangeMoment = QDateTime::fromString("05.10.2009 04:00:00", "dd'.'MM'.'yyyy' 'hh:mm:ss");
+       QDateTime daylightSaveTimeChangeMoment = QDateTime::fromString("01.04.2010 03:00:00", "dd'.'MM'.'yyyy' 'hh:mm:ss");
+       DateTimeSettings::weekDay dayOfWeek = DateTimeSettings::Sunday;
+       
+       for ( QDomNode node = aXML.firstChild(); !node.isNull(); node = node.nextSibling() )
+       {
+               QDomElement e = node.toElement();
+               QString tagName = e.tagName().toLower();
+
+               if ( tagName == QString( "dayofweek" ) )
+               {
+                       qDebug() << "Configuration::readDateTimeSettings: " +e.text();
+                       
+                       bool success = false;
+                       unsigned int weekDayTmp = e.text().toUInt( &success );
+                       if( success && weekDayTmp >= 0 && weekDayTmp < 7)
+                       {
+                               dayOfWeek = (DateTimeSettings::weekDay)weekDayTmp;
+                       }
+               }
+               else if( tagName == QString( "standardtimechangemoment" ) )
+               {
+                       standardTimeChangeMoment = QDateTime::fromString(e.text(), "dd'.'MM'.'yyyy' 'hh:mm:ss");
+                       qDebug() << "Configuration::readDateTimeSettings: " +standardTimeChangeMoment.toString("dd.MM.yyyy hh:mm:ss");
+               }
+               else if( tagName == QString( "daylightsavetimechangemoment" ) )
+               {
+                       daylightSaveTimeChangeMoment = QDateTime::fromString(e.text(), "dd'.'MM'.'yyyy' 'hh:mm:ss");
+                       qDebug() << "Configuration::readDateTimeSettings: " +daylightSaveTimeChangeMoment.toString("dd.MM.yyyy hh:mm:ss");
+               }
+       }
+       
+       return new DateTimeSettings(standardTimeChangeMoment, daylightSaveTimeChangeMoment, dayOfWeek);
+}
+
 QByteArray Configuration::readAdminPassword( const QDomNode &aXML )
 {
        QDomElement e = aXML.toElement();
index c08002d..5cd7e6d 100644 (file)
@@ -11,6 +11,7 @@ class StartupSettings;
 class DisplaySettings;
 class Room;
 class QDomNode;
+class DateTimeSettings;
 
 //! Domain class. Store application wide configuration values.
 /*!
@@ -20,7 +21,7 @@ class QDomNode;
  */
 class Configuration : public QObject
 {
-       Q_OBJECT
+Q_OBJECT
 
 private:
        //! Constructor.
@@ -76,6 +77,12 @@ public:
         * \return Pointer to DisplaySettings instance.
         */
        DisplaySettings* displaySettings();
+       //! Gets date/time settings.
+       /*!
+        * Gets the date/time settings.
+        * \return Pointer to DateTimeSettings instance.
+        */
+       DateTimeSettings* dateTimeSettings();
        //! Gets the administrator's password.
        /*!
         * Gets the administrator's password
@@ -87,8 +94,8 @@ public:
         * Sets  room list.
         * \param aRooms List of rooms
         */
-       void setRooms( const QList<Room*> aRooms );
-       
+       void setRooms(const QList<Room*> aRooms);
+
 public slots:
 
        //! Saves setting values to file.
@@ -104,85 +111,100 @@ private:
         * \param aPath path and name of configuration file
         * \return Configuration object.
         */
-       static Configuration* readFromXML( const QString &aPath );
+       static Configuration* readFromXML(const QString &aPath);
        //! Static. Reads settings of connection from and XML node.
        /*!
         * Static. Reads settings of connection from an XML node.
         * \param aXml QDomNode containing connection parameters.
         * \return Pointer to ConnectionSettings object.
         */
-       static ConnectionSettings* readConnectionSettings( const QDomNode &aXML );
+       static ConnectionSettings* readConnectionSettings(const QDomNode &aXML);
        //! Static. Reads rooms from an XML node.
        /*!
         * Static. Reads rooms from an XML node.
         * \param aXml QDomNode containing meeting room parameters
         * \return List of meetingrooms.
         */
-       static QList<Room*> readRooms( const QDomNode &aXML );
+       static QList<Room*> readRooms(const QDomNode &aXML);
        //! Static. Reads language code from an XML node.
        /*!
         * Static. Reads rooms from an XML node.
         * \param aXml QDomNode containing language code
         * \return Language code.
         */
-       static QString readLanguageCode( const QDomNode &aXML );
+       static QString readLanguageCode(const QDomNode &aXML);
        //! Static. Reads settings of startup from an XML node.
        /*!
         * Static. Reads settings of startup from an XML node.
         * \param aXml QDomNode containing startup parameters
         * \return Pointer to the read StartupSettings object.
         */
-       static StartupSettings* readStartupSettings( const QDomNode &aXML );
+       static StartupSettings* readStartupSettings(const QDomNode &aXML);
        /*!
         * Static function to load and store display settings from xml node.
         * \param aXml QDomNode containing display parameters
         * \return Pointer to the read DisplaySettings object.
         */
-       static DisplaySettings* readDisplaySettings( const QDomNode &aXML );
+       static DisplaySettings* readDisplaySettings(const QDomNode &aXML);
+       //! Static. Reads the date/time settings from an XML node.
+       /*!
+        * Static. Reads the date/time settings from an XML node.
+        * \param aXml QDomNode containing the date/time settings
+        * \return The date/time settings.
+        */
+       static DateTimeSettings* readDateTimeSettings(const QDomNode &aXML);
+
        //! Static. Reads adminstrator's password from an XML node.
        /*!
         * Static. Reads adminstrator's password from an XML node.
         * \param aXml QDomNode containing admin password
         * \return Admin password.
         */
-       static QByteArray readAdminPassword( const QDomNode &aXML );
+       static QByteArray readAdminPassword(const QDomNode &aXML);
 
        //! Saves connection data to the document.
        /*!
         * Reads data from iConnectionSettings and saves it to the aXML document.
         * \param aXml QDomNode containing connection parameters.
         */
-       void saveConnectionSettings( const QDomNode &aXML );
+       void saveConnectionSettings(const QDomNode &aXML);
        //! Saves meeting rooms to the document.
        /*!
         * Reads data from iRooms list and saves it to the aXML document.
         * \param aXml QDomNode containing meeting room parameters
         */
-       void saveRooms( const QDomNode &aXML );
+       void saveRooms(const QDomNode &aXML);
        //! Saves the language code.
        /*!
         * Reads data from iLanguageCode and saves it to the aXML document.
         * \param aXml QDomNode containing language code
         */
-       void saveLanguageCode( const QDomNode &aXML );
+       void saveLanguageCode(const QDomNode &aXML);
        //! Saves startup setting data to the document.
        /*!
         * Reads data from iStartupSettings and saves it to the aXML document.
         * \param aXml QDomNode containing startup parameters
         */
-       void saveStartupSettings( const QDomNode &aXML );
+       void saveStartupSettings(const QDomNode &aXML);
        //! Saves display setting data to the document.
        /*!
         * Reads data from iDisplaySettings and saves it to the aXML document.
         * \param aXml QDomNode containing display parameters
         */
-       void saveDisplaySettings( const QDomNode &aXML );
+       void saveDisplaySettings(const QDomNode &aXML);
+       //! Saves date/time setting data to the document.
+       /*!
+        * Reads data from iDateTimeSettings and saves it to the aXML document.
+        * \param aXml QDomNode containing the date/time settings
+        */
+       void saveDateTimeSettings(const QDomNode &aXML);
+
        //! Saves admin password to the document.
        /*!
         * Reads data from iAdminPassword and saves it to the aXML document.
         * \param aXml QDomNode containing admin password
         */
-       void saveAdminPassword( const QDomNode &aXML );
+       void saveAdminPassword(const QDomNode &aXML);
 
        //! Hash password with md5 method.
        /*!
@@ -190,7 +212,7 @@ private:
         * \param aPassword password to be encoded
         * \return Encoded password.
         */
-       QString hashPassword( const QString aPassword );
+       QString hashPassword(const QString aPassword);
 
 private:
        //! Path and name of configuration file
@@ -205,6 +227,8 @@ private:
        StartupSettings *iStartupSettings;
        //! Stores display settings.
        DisplaySettings *iDisplaySettings;
+       //! Stores date/time settings.
+       DateTimeSettings *iDateTimeSettings;
        //! List of meeting rooms.
        QList<Room*> iRooms;
        //! Stores administrator password.
diff --git a/src/Domain/Configuration/DateTimeSettings.cpp b/src/Domain/Configuration/DateTimeSettings.cpp
new file mode 100644 (file)
index 0000000..83c6767
--- /dev/null
@@ -0,0 +1,129 @@
+#include "DateTimeSettings.h"
+#include <QtDebug>
+
+const QString DateTimeSettings::weekDays[DAYS_IN_A_WEEK]=
+{ 
+       "Sunday", 
+       "Monday", 
+       "Tuesday", 
+       "Wednesday", 
+       "Thursday", 
+       "Friday",
+       "Saturday" 
+};
+
+DateTimeSettings::DateTimeSettings(const QDateTime &aStandardTimeChange, const QDateTime &aDaylightTimeChange, weekDay aDayOfWeek)
+{
+       this->iDaylightSaveTimeChangeMoment = aDaylightTimeChange;
+       this->iStandardTimeChangeMoment = aStandardTimeChange;
+       this->iDayOfWeek = aDayOfWeek;
+}
+
+DateTimeSettings::DateTimeSettings(const DateTimeSettings &aOther)
+{
+       this->iDaylightSaveTimeChangeMoment = aOther.iDaylightSaveTimeChangeMoment;
+       this->iStandardTimeChangeMoment = aOther.iStandardTimeChangeMoment;
+       this->iDayOfWeek = aOther.iDayOfWeek;
+}
+
+DateTimeSettings::~DateTimeSettings()
+{
+
+}
+
+QDateTime DateTimeSettings::STDDateTime()
+{
+       return (this->iStandardTimeChangeMoment);
+}
+
+QDateTime DateTimeSettings::DSTDateTime()
+{
+       return (this->iDaylightSaveTimeChangeMoment);
+}
+
+QString DateTimeSettings::STDTime()
+{
+       QTime time = this->iStandardTimeChangeMoment.time();
+
+       qDebug() << "DateTimeSettings::standardTimeChange_Time: "
+                       +time.toString("hh:mm:ss");
+
+       return (time.toString("hh:mm:ss"));
+}
+
+QString DateTimeSettings::STDMonth()
+{
+       QDate date = this->iStandardTimeChangeMoment.date();
+
+       qDebug() << "DateTimeSettings::standardTimeChange_Month: "
+                       +date.toString("MM");
+
+       return (date.toString("M"));
+}
+
+QString DateTimeSettings::STDDay()
+{
+       QDate date = this->iStandardTimeChangeMoment.date();
+
+       qDebug() << "DateTimeSettings::standardTimeChange_Day: "
+                       +date.toString("dd");
+
+       return (date.toString("d"));
+}
+
+QString DateTimeSettings::DSTTime()
+{
+       QTime time = this->iDaylightSaveTimeChangeMoment.time();
+
+       qDebug() << "DateTimeSettings::daylightSaveTimeChange_Time: "
+                       +time.toString("hh:mm:ss");
+
+       return (time.toString("hh:mm:ss"));
+}
+
+QString DateTimeSettings::DSTMonth()
+{
+       QDate date = this->iDaylightSaveTimeChangeMoment.date();
+
+       qDebug() << "DateTimeSettings::daylightSaveTimeChange_Month: "
+                       +date.toString("MM");
+
+       return (date.toString("M"));
+}
+
+QString DateTimeSettings::DSTDay()
+{
+       QDate date = this->iDaylightSaveTimeChangeMoment.date();
+
+       qDebug() << "DateTimeSettings::daylightSaveTimeChange_Day: "
+                       +date.toString("dd");
+
+       return (date.toString("d"));
+}
+
+void DateTimeSettings::setDSTDateTime(const QDateTime &aDaylightSaveTimeChange)
+{
+       this->iDaylightSaveTimeChangeMoment = aDaylightSaveTimeChange;
+       qDebug() << "DateTimeSettings::setDaylightSaveTimeChange: "
+                               +this->iDaylightSaveTimeChangeMoment.toString("dd.MM.yyyy hh:mm:ss");
+}
+
+void DateTimeSettings::setSTDDateTime(const QDateTime &aStandardTimeChange)
+{
+       this->iStandardTimeChangeMoment = aStandardTimeChange;
+       qDebug() << "DateTimeSettings::setStandardTimeChange: "
+                                       +this->iStandardTimeChangeMoment.toString("dd.MM.yyyy hh:mm:ss");
+}
+
+void DateTimeSettings::setSwitchDay(weekDay aDay)
+{
+       this->iDayOfWeek = aDay;
+       qDebug() << "DateTimeSettings::setDayOfWeek: "
+                                               +DateTimeSettings::weekDays[this->iDayOfWeek];
+}
+
+QString DateTimeSettings::switchDay()
+{
+       qDebug() << "DateTimeSettings::dayOfWeek: " +DateTimeSettings::weekDays[this->iDayOfWeek];
+       return(DateTimeSettings::weekDays[this->iDayOfWeek]);
+}
diff --git a/src/Domain/Configuration/DateTimeSettings.h b/src/Domain/Configuration/DateTimeSettings.h
new file mode 100644 (file)
index 0000000..6c79e7d
--- /dev/null
@@ -0,0 +1,118 @@
+#ifndef DATETIMESETTINGS_H_
+#define DATETIMESETTINGS_H_
+
+#include <QDateTime>
+#include <QString>
+
+#define DAYS_IN_A_WEEK 7
+
+class DateTimeSettings
+{
+public:
+
+       /*!
+        * An enumeration for the weekdays to be used.
+        */
+       typedef enum 
+       {
+               Sunday = 0,
+               Monday,
+               Tuesday,
+               Wednesday,
+               Thursday,
+               Friday,
+               Saturday
+       } weekDay;
+
+       /*!
+        * Overloaded.
+        * \param aStandardTimeChange The date and time when the standard time is to be used. The year part and the milliseconds are omitted.
+        * \param aDaylightTimeChange The date and time when the daylight time is to be used. The year part and the milliseconds are omitted.
+        * \param aDayOfWeek The day of the week when the time is to be used.
+        */
+       DateTimeSettings(const QDateTime &aStandardTimeChange, const QDateTime &aDaylightTimeChange, weekDay aDayOfWeek);
+
+       //! Copy constructor.
+       /*!
+        * Overloaded. Constructor to initialize a DateTimeSettings instance.
+        * \param aOther DateTimeSettings class to be copied.
+        */
+       DateTimeSettings(const DateTimeSettings &aOther);
+       //! Destructor
+       virtual ~DateTimeSettings();
+
+       /*!
+        * \return The Date/time when the standard time is to be switched into use
+        */
+       QDateTime STDDateTime();
+
+       /*!
+        * \return The Date/time when the daylight saving time is to be switched into use
+        */
+       QDateTime DSTDateTime();
+
+       /*!
+        * \return The time as a string (hh:mm:ss) of the moment the standard time is to be switched into use
+        */
+       QString STDTime();
+
+       /*!
+        * \return The month as a string (MM) of the moment the standard time is to be switched into use
+        */
+       QString STDMonth();
+
+       /*!
+        * \return The day as a string (dd) of the moment the standard time is to be switched into use
+        */
+       QString STDDay();
+
+       /*!
+        * \return The time as a string (hh:mm:ss) of the moment the daylight saving time is to be switched into use
+        */
+       QString DSTTime();
+
+       /*!
+        * \return The month as a string (MM) of the moment the daylight saving time is to be switched into use
+        */
+       QString DSTMonth();
+
+       /*!
+        * \return The day as a string (dd) of the moment the daylight saving time is to be switched into use
+        */
+       QString DSTDay();
+
+       /*!
+        * Sets the time/date of the moment the daylight saving time is to be switched into use
+        */
+       void setDSTDateTime(const QDateTime &aDaylightSaveTimeChange);
+
+       /*!
+        * Sets the time/date of the moment the standard time is to be switched into use
+        */
+       void setSTDDateTime(const QDateTime &aStandardTimeChange);
+
+       /*!
+        * Sets the appropriate day of the week the time switch is carried out.
+        * \see DateTimeSettings::weekDay
+        */
+       void setSwitchDay(DateTimeSettings::weekDay aDay);
+
+       /*!
+        * \return The appropriate day of the week the time switch is carried out.
+        */
+       QString switchDay();
+
+private:
+       QDateTime iStandardTimeChangeMoment;
+       QDateTime iDaylightSaveTimeChangeMoment;
+       weekDay iDayOfWeek;
+
+       /*!
+        * Contains the weekday strings that are passed to the exchange server when
+        * defining the timezone variables
+        */
+       static const QString weekDays[DAYS_IN_A_WEEK];
+};
+
+
+#endif /*DATETIMESETTINGS_H_*/
index 8174ef7..c941c7d 100644 (file)
@@ -93,12 +93,10 @@ void CommunicationManager::fetchMeetingDetails( Meeting& aMeeting )
 
 void CommunicationManager::cancelFetchMeetingDetails()
 {
-       const RequestData *rd = NULL;
-       for( rd = findRequest( GetCalendarItem );rd != NULL; )
-       {
-               int id =  rd->requestId;
+       const RequestData *rd = findRequest( GetCalendarItem );
+       if( rd != NULL ) {
+               int id = rd->requestId;
                iCancelledRequests.append( id );
-               rd = findRequest( GetCalendarItem );
        }
 }
 
index d12b73a..dfa0ee7 100644 (file)
@@ -4,58 +4,60 @@
 #include "MessagingUtils.h"
 #include "Meeting.h"
 #include "Configuration.h"
+#include "DateTimeSettings.h"
 
 /*
  * BaseMessage class functions
-*/
+ */
 BaseMessage::BaseMessage()
 {
 #ifdef MU_DEBUG
-       qDebug( "BaseMessage::BaseMessage" );
+       qDebug("BaseMessage::BaseMessage");
 #endif
        iMessage = new QDomDocument();
 #ifdef MU_DEBUG
-       qDebug( "BaseMessage::BaseMessage end" );
+       qDebug("BaseMessage::BaseMessage end");
 #endif
 }
 
 BaseMessage::~BaseMessage()
 {
 #ifdef MU_DEBUG
-       qDebug( "BaseMessage::~BaseMessage" );
+       qDebug("BaseMessage::~BaseMessage");
 #endif
-       if( iMessage )
-               {
+       if (iMessage)
+       {
                delete iMessage;
                iMessage = 0;
-               }
+       }
 #ifdef MU_DEBUG
-       qDebug( "BaseMessage::~BaseMessage end" );
+       qDebug("BaseMessage::~BaseMessage end");
 #endif
 }
 
-QList<QDomNode> BaseMessage::getNodesByName( const QString& aNodeName, const QString& aParentName, QDomNode* aRootNode )
+QList<QDomNode> BaseMessage::getNodesByName(const QString& aNodeName, const QString& aParentName, QDomNode* aRootNode)
 {
 #ifdef MU_DEBUG
-       qDebug( "BaseMessage::getNodesByName" );
+       qDebug("BaseMessage::getNodesByName");
 #endif
-       
+
        //TODO: Add implementation for attribute search
-       
+
        QDomNodeList list;
        QList<QDomNode> specList;
-       
-       list = ( aRootNode ) ? aRootNode->toElement().elementsByTagName( aNodeName ) : iMessage->elementsByTagName( aNodeName );
 
-       for( int i=0; i<list.count(); i++ )
+       list
+                       = (aRootNode ) ? aRootNode->toElement().elementsByTagName(aNodeName) : iMessage->elementsByTagName(aNodeName);
+
+       for (int i=0; i<list.count(); i++)
        {
-               if( aParentName != QString::null )
+               if (aParentName != QString::null )
                {
-               if( !list.item( i ).parentNode().isNull() && list.item( i ).parentNode().isElement() && list.item( i ).parentNode().toElement().tagName().compare( aParentName ) == 0 )
+                       if( !list.item( i ).parentNode().isNull() && list.item( i ).parentNode().isElement() && list.item( i ).parentNode().toElement().tagName().compare( aParentName ) == 0 )
                        specList.append( list.item( i ) );
                }
                else
-                       specList.append( list.item( i ) );
+               specList.append( list.item( i ) );
        }
 #ifdef MU_DEBUG
        qDebug( "BaseMessage::getNodesByName end" );
@@ -63,59 +65,54 @@ QList<QDomNode> BaseMessage::getNodesByName( const QString& aNodeName, const QSt
        return specList;
 }
 
-QDomNode BaseMessage::getNodeFromDocument( const QString& aNodeName,
-                                                               QDomNode::NodeType aNodeType,
-                                                               const QString& aParentName,
-                                                               int aIndex,
-                                                               QDomNode* aRootNode )
+QDomNode BaseMessage::getNodeFromDocument(const QString& aNodeName, QDomNode::NodeType aNodeType, const QString& aParentName, int aIndex, QDomNode* aRootNode)
 {
 #ifdef MU_DEBUG
-       qDebug( "BaseMessage::getNodeFromDocument" );
+       qDebug("BaseMessage::getNodeFromDocument");
 #endif
        QDomNode node;
-       if( aNodeType == QDomNode::ElementNode )
-               node = getElementFromDocument( aNodeName, aParentName, aIndex, aRootNode );
-       else if( aNodeType == QDomNode::AttributeNode )
-               node = getAttributeFromDocument( aNodeName, aParentName, aIndex, aRootNode );
-#ifdef MU_DEBUG
-       qDebug( "BaseMessage::getNodeFromDocument end" );
+       if (aNodeType == QDomNode::ElementNode)
+               node
+                               = getElementFromDocument(aNodeName, aParentName, aIndex, aRootNode);
+       else if (aNodeType == QDomNode::AttributeNode)
+               node
+                               = getAttributeFromDocument(aNodeName, aParentName, aIndex, aRootNode);
+#ifdef MU_DEBUG
+       qDebug("BaseMessage::getNodeFromDocument end");
 #endif
        return node;
 }
 
-QDomNode BaseMessage::getAttributeFromDocument( const QString& aAttributeName,
-                                                               const QString& aParentName,
-                                                               int aIndex,
-                                                               QDomNode* aRootNode )
+QDomNode BaseMessage::getAttributeFromDocument(const QString& aAttributeName, const QString& aParentName, int aIndex, QDomNode* aRootNode)
 {
 #ifdef MU_DEBUG
-       qDebug( "BaseMessage::getAttributeFromDocument" );
+       qDebug("BaseMessage::getAttributeFromDocument");
 #endif
 
        QDomNode root;
        QDomNode node;
        QDomNode parent;
-       
+
        root = ( !aRootNode ) ? iMessage->documentElement() : *aRootNode;
-       if( root.isNull() )
-               {
+       if (root.isNull() )
+       {
 #ifdef MU_DEBUG
-       qDebug( "BaseMessage::getAttributeFromDocument : RootNode is NULL." );
+               qDebug("BaseMessage::getAttributeFromDocument : RootNode is NULL.");
 #endif         
                return node;
-               }
+       }
 
-       if( aParentName != QString::null )
+       if (aParentName != QString::null )
        {
                if( root.isElement() )
                {
                        QDomNodeList list = root.toElement().elementsByTagName( aParentName );
-                       if( list.count() > 0 ) parent = list.item( 0 );
+                       if( list.count()> 0 ) parent = list.item( 0 );
                }
        }
-       
+
        QDomNamedNodeMap attrs = parent.attributes();
-       
+
        int count = attrs.count();
        if( count==0 || aIndex >= count || !attrs.contains( aAttributeName ) ) return root;
 
@@ -132,109 +129,104 @@ QDomNode BaseMessage::getAttributeFromDocument( const QString& aAttributeName,
                                list.append( attr );
                        }
                        else
-                               list.append( attr );
+                       list.append( attr );
                }
 
        }
 
-       if( list.count() > 0 )
-               node = list.at( aIndex );
+       if( list.count()> 0 )
+       node = list.at( aIndex );
 
 #ifdef MU_DEBUG
        qDebug( "BaseMessage::getAttributeFromDocument end." );
 #endif 
-       
+
        return node;
 }
 
-QDomNode BaseMessage::getElementFromDocument( const QString& aElementName,
-                                                               const QString& aParentName,
-                                                               int aIndex,
-                                                               QDomNode* aRootNode )
+QDomNode BaseMessage::getElementFromDocument(const QString& aElementName, const QString& aParentName, int aIndex, QDomNode* aRootNode)
 {
 #ifdef MU_DEBUG
-       qDebug( "BaseMessage::getElementFromDocument" );
+       qDebug("BaseMessage::getElementFromDocument");
 #endif
-               QDomNode node;
-               QDomNodeList elems;
+       QDomNode node;
+       QDomNodeList elems;
 
-               if( !aRootNode )
-               {
-               elems = iMessage->elementsByTagName( aElementName );
-               }
-               else
-               {
-               elems = aRootNode->toElement().elementsByTagName( aElementName );
-               }
+       if ( !aRootNode)
+       {
+               elems = iMessage->elementsByTagName(aElementName);
+       }
+       else
+       {
+               elems = aRootNode->toElement().elementsByTagName(aElementName);
+       }
 
-               int count = elems.count();
-               if( count == 0 || aIndex >= count )
-               { 
+       int count = elems.count();
+       if (count == 0 || aIndex >= count)
+       {
 #ifdef MU_DEBUG
-       qDebug( "BaseMessage::getElementFromDocument : No Elements found." );
+               qDebug("BaseMessage::getElementFromDocument : No Elements found.");
 #endif                 
-                       return node; //no elements found
-               }
+               return node; //no elements found
+       }
 
-               QList<QDomElement> list;
+       QList<QDomElement> list;
 
-               for( int i=0; i<count; i++ )
+       for (int i=0; i<count; i++)
+       {
+               QDomElement elem = elems.item( i ).toElement();
+               if (elem.tagName().compare(aElementName) == 0 || elem.localName().compare(aElementName) == 0)
                {
-                       QDomElement elem = elems.item( i ).toElement();
-                       if( elem.tagName().compare( aElementName ) == 0 || elem.localName().compare( aElementName ) == 0 )
+                       if (aParentName != QString::null )
                        {
-                               if( aParentName != QString::null )
+                               if( !elem.parentNode().isNull() )
                                {
-                                       if( !elem.parentNode().isNull() )
-                                       {
-                                               if( elem.parentNode().toElement().tagName().compare( aParentName ) == 0 || elem.parentNode().toElement().tagName().compare( aParentName ) == 0 )
-                                                       list.append( elem );
-                                       }
-                               }
-                               else
+                                       if( elem.parentNode().toElement().tagName().compare( aParentName ) == 0 || elem.parentNode().toElement().tagName().compare( aParentName ) == 0 )
                                        list.append( elem );
+                               }
                        }
-
+                       else
+                       list.append( elem );
                }
 
-               if( list.count() > 0 )
-                       node = list.at( aIndex );
+       }
+
+       if( list.count()> 0 )
+       node = list.at( aIndex );
 
 #ifdef MU_DEBUG
        qDebug( "BaseMessage::getElementFromDocument end" );
 #endif         
-               return node;
+       return node;
 }
 
-bool BaseMessage::matchName( const QDomNode& aNode, const QString& aName )
+bool BaseMessage::matchName(const QDomNode& aNode, const QString& aName)
 {
 #ifdef MU_DEBUG
-       qDebug( "BaseMessage::matchName" );
+       qDebug("BaseMessage::matchName");
 #endif
-       if( aNode.isElement() )
+       if (aNode.isElement() )
        {
-               if( aNode.toElement().tagName().toLower().compare( aName.toLower() ) == 0
-                               || aNode.localName().toLower().compare( aName.toLower() ) == 0 )
+               if (aNode.toElement().tagName().toLower().compare(aName.toLower() ) == 0 || aNode.localName().toLower().compare(aName.toLower() ) == 0)
                {
 #ifdef MU_DEBUG
-       qDebug( "BaseMessage::matchName end" );
+                       qDebug("BaseMessage::matchName end");
 #endif                 
                        return true;
                }
        }
-       else if( aNode.isAttr() )
+       else if (aNode.isAttr() )
        {
-               if( aNode.toAttr().name().toLower().compare( aName.toLower() ) == 0
-                               || aNode.localName().toLower().compare( aName.toLower() ) == 0 )
+               if (aNode.toAttr().name().toLower().compare(aName.toLower() ) == 0 || aNode.localName().toLower().compare(aName.toLower() ) == 0)
                {
 #ifdef MU_DEBUG
-       qDebug( "BaseMessage::matchName end" );
+                       qDebug("BaseMessage::matchName end");
 #endif                 
                        return true;
                }
        }
 #ifdef MU_DEBUG
-       qDebug( "BaseMessage::matchName : No match." );
+       qDebug("BaseMessage::matchName : No match.");
 #endif 
        return false;
 }
@@ -242,63 +234,64 @@ bool BaseMessage::matchName( const QDomNode& aNode, const QString& aName )
 QByteArray BaseMessage::getMessage()
 {
 #ifdef MU_DEBUG
-       qDebug( "BaseMessage::getMessage" );
+       qDebug("BaseMessage::getMessage");
 #endif
        QByteArray msg;
-       if( iMessage )
+       if (iMessage)
        {
-               msg.append( iMessage->toByteArray() );
+               msg.append(iMessage->toByteArray() );
        }
 #ifdef MU_DEBUG
-       qDebug( "BaseMessage::getMessage end" );
+       qDebug("BaseMessage::getMessage end");
 #endif 
        return msg;
 }
 
 /*
  * RequestMessage class functions
-*/
-RequestMessage::RequestMessage( RequestCommandId aCommandId ) : iCurrCmd( aCommandId )
+ */
+RequestMessage::RequestMessage(RequestCommandId aCommandId) :
+       iCurrCmd(aCommandId)
 {
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::RequestMessage" );
+       qDebug("RequestMessage::RequestMessage");
 #endif
        createEnvelopeBase();
 
-       if( aCommandId != ReqCmdNoCommand )
+       if (aCommandId != ReqCmdNoCommand)
        {
-               createMessageStructure( aCommandId );
+               createMessageStructure(aCommandId);
        }
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::RequestMessage end" );
+       qDebug("RequestMessage::RequestMessage end");
 #endif
 }
 
-RequestMessage::RequestMessage( const QString& /*aFileName*/ )
+RequestMessage::RequestMessage(const QString& /*aFileName*/)
 {
        //createEnvelopeBase();
        //TODO: read operation structures from a file
 }
 
-int RequestMessage::addNode( const QDomNode& aNode, QDomNode::NodeType aNodeType, const QString& aParentName, int aIndex, QDomNode* aRootNode )
+int RequestMessage::addNode(const QDomNode& aNode, QDomNode::NodeType aNodeType, const QString& aParentName, int aIndex, QDomNode* aRootNode)
 {
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::addNode" );
+       qDebug("RequestMessage::addNode");
 #endif
 
-       if( !iMessage )
+       if ( !iMessage)
        {
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::addNode : iMessage is NULL." );
+               qDebug("RequestMessage::addNode : iMessage is NULL.");
 #endif 
                return MsgErrSomeError;
        }
 
        int err = MsgErrNoError;
 
-       if( aNodeType == QDomNode::ElementNode && aNode.isElement() )
+       if (aNodeType == QDomNode::ElementNode && aNode.isElement() )
        {
-               if( aParentName == QString::null )
+               if (aParentName == QString::null )
                {
                        if( !aRootNode )
                        iMessage->appendChild( aNode );
@@ -308,7 +301,7 @@ int RequestMessage::addNode( const QDomNode& aNode, QDomNode::NodeType aNodeType
                else
                {
                        QDomNodeList list = ( aRootNode ) ? aRootNode->toElement().elementsByTagName( aParentName ) : iMessage->elementsByTagName( aParentName );
-                               
+
                        if( list.count() == 0 || aIndex >= list.count() ) err = MsgErrSomeError;
                        else
                        {
@@ -322,7 +315,7 @@ int RequestMessage::addNode( const QDomNode& aNode, QDomNode::NodeType aNodeType
                if( aParentName != QString::null )
                {
                        QDomNodeList list = ( aRootNode ) ? aRootNode->toElement().elementsByTagName( aParentName ) : iMessage->elementsByTagName( aParentName );
-                               
+
                        if( list.count() == 0 || aIndex >= list.count() ) err = MsgErrSomeError;
                        else
                        {
@@ -331,10 +324,10 @@ int RequestMessage::addNode( const QDomNode& aNode, QDomNode::NodeType aNodeType
                        }
                }
                else
-                       err = MsgErrSomeError; //Attribute must have a parent specified
+               err = MsgErrSomeError; //Attribute must have a parent specified
        }
        else
-               err = MsgErrSomeError;
+       err = MsgErrSomeError;
 
 #ifdef MU_DEBUG
        qDebug( "RequestMessage::addNode end : err=%d", err );
@@ -342,34 +335,36 @@ int RequestMessage::addNode( const QDomNode& aNode, QDomNode::NodeType aNodeType
        return err;
 }
 
-int RequestMessage::setNodeValue( const QString& aNodeName, const QString& aValue, QDomNode::NodeType aNodeType, const QString& aParentName, int aIndex, QDomNode* aRootNode )
+int RequestMessage::setNodeValue(const QString& aNodeName, const QString& aValue, QDomNode::NodeType aNodeType, const QString& aParentName, int aIndex, QDomNode* aRootNode)
 {
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::setNodeValue" );
+       qDebug("RequestMessage::setNodeValue");
 #endif
 
-       QDomNode node = getNodeFromDocument( aNodeName, aNodeType, aParentName, aIndex, aRootNode );
-       if( node.isNull() || !iMessage )
-               {
+       QDomNode
+                       node =
+                                       getNodeFromDocument(aNodeName, aNodeType, aParentName, aIndex, aRootNode);
+       if (node.isNull() || !iMessage)
+       {
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::setNodeValue : Node is NULL or iMessage is NULL." );
+               qDebug("RequestMessage::setNodeValue : Node is NULL or iMessage is NULL.");
 #endif         
                return MsgErrSomeError;
-               }
+       }
 
        int err = MsgErrNoError;
 
-       if( node.isElement() )
+       if (node.isElement() )
        {
-               node.appendChild( iMessage->createTextNode( aValue ) );
+               node.appendChild(iMessage->createTextNode(aValue) );
        }
-       else if( node.isAttr() )
-               node.toAttr().setValue( aValue );
+       else if (node.isAttr() )
+               node.toAttr().setValue(aValue);
        else
                err = MsgErrSomeError;
 
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::setNodeValue end : err=%d", err );
+       qDebug("RequestMessage::setNodeValue end : err=%d", err);
 #endif 
        return err;
 }
@@ -377,37 +372,38 @@ int RequestMessage::setNodeValue( const QString& aNodeName, const QString& aValu
 int RequestMessage::createEnvelopeBase()
 {
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::createEnvelopeBase" );
+       qDebug("RequestMessage::createEnvelopeBase");
 #endif
-       if( iMessage )
-               {
+       if (iMessage)
+       {
                delete iMessage;
                iMessage = 0;
-               }
+       }
 
        iMessage = new QDomDocument();
 
-       int size = sizeof( reqCmdArrayEnvelopeBase ) / sizeof( MessageBodyElement );
+       int size = sizeof(reqCmdArrayEnvelopeBase ) / sizeof(MessageBodyElement);
        int err = MsgErrNoError;
 
-       QDomNode base = constructArrayToNode( reqCmdArrayEnvelopeBase, size );
+       QDomNode base = constructArrayToNode(reqCmdArrayEnvelopeBase, size);
 
-       if( !base.isNull() )
-               err = addNode( base );
-       else err = MsgErrSomeError;
+       if ( !base.isNull() )
+               err = addNode(base);
+       else
+               err = MsgErrSomeError;
 
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::createEnvelopeBase end : err=%d", err );
+       qDebug("RequestMessage::createEnvelopeBase end : err=%d", err);
 #endif         
        return err;
 }
 
-QString RequestMessage::getContentTypeForHeader( RequestCommandId aCommandId )
+QString RequestMessage::getContentTypeForHeader(RequestCommandId aCommandId)
 {
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::getContentTypeForHeader" );
+       qDebug("RequestMessage::getContentTypeForHeader");
 #endif
-       QString contentType( QString::null );
+       QString contentType(QString::null );
 
        RequestCommandId cmd = ( aCommandId == ReqCmdNoCommand ) ? iCurrCmd : aCommandId;
 
@@ -416,45 +412,48 @@ QString RequestMessage::getContentTypeForHeader( RequestCommandId aCommandId )
                QString operation( QString::null );
                switch( cmd )
                {
-               //Used commands
-               case ReqCmdGetUserAvailability : { operation = "GetUserAvailability"; } break;
-               case ReqCmdConvertId : { operation = "ConvertId"; } break;
-               case ReqCmdGetItem : { operation = "GetItem"; } break;
-
-               //Currently unused operations
-
-               /*case ReqCmdAddDelegate : { operation = "AddDelegate"; } break;
-               case ReqCmdCopyFolder : { operation = "CopyFolder"; } break;
-               case ReqCmdCopyItem : { operation = "CopyItem"; } break;
-               case ReqCmdCreateAttachment : { operation = "CreateAttachment"; } break;
-               case ReqCmdCreateFolder : { operation = "CreateFolder"; } break;
-               case ReqCmdCreateItem : { operation = "CreateItem"; } break;
-               case ReqCmdCreateManagedFolder : { operation = "CreateManagedFolder"; } break;
-               case ReqCmdDeleteAttachment : { operation = "DeleteAttachment"; } break;
-               case ReqCmdDeleteFolder : { operation = "DeleteFolder"; } break;
-               case ReqCmdDeleteItem : { operation = "DeleteItem"; } break;
-               case ReqCmdExpandDL : { operation = "ExpandDL"; } break;
-               case ReqCmdFindFolder : { operation = "FindFolder"; } break;
-               case ReqCmdFindItem : { operation = "FindItem"; } break;
-               case ReqCmdGetAttachment : { operation = "GetAttachment"; } break;
-               case ReqCmdGetDelegate : { operation = "GetDelegate"; } break;
-               case ReqCmdGetEvents : { operation = "GetEvents"; } break;
-               case ReqCmdGetFolder : { operation = "GetFolder"; } break;
-               case ReqCmdGetUserOofSettings : { operation = "GetUserOofSettings"; } break;
-               case ReqCmdMoveFolder : { operation = "MoveFolder"; } break;
-               case ReqCmdMoveItem : { operation = "MoveItem"; } break;
-               case ReqCmdRemoveDelegate : { operation = "RemoveDelegate"; } break;
-               case ReqCmdResolveNames : { operation = "ResolveNames"; } break;
-               case ReqCmdSendItem : { operation = "SendItem"; } break;
-               case ReqCmdSetUserOofSettings : { operation = "SetUserOofSettings"; } break;
-               case ReqCmdSubscribe : { operation = "Subscribe"; } break;
-               case ReqCmdSyncFolderHierarchy : { operation = "SyncFolderHierarchy"; } break;
-               case ReqCmdSyncFolderItems : { operation = "SyncFolderItems"; } break;
-               case ReqCmdUnsubscribe : { operation = "Unsubscribe"; } break;
-               case ReqCmdUpdateDelegate : { operation = "UpdateDelegate"; } break;
-               case ReqCmdUpdateFolder : { operation = "UpdateFolder"; } break;
-               case ReqCmdUpdateItem : { operation = "UpdateItem"; } break;*/
-               default: break;
+                       //Used commands
+                       case ReqCmdGetUserAvailability :
+                       {       operation = "GetUserAvailability";}break;
+                       case ReqCmdConvertId :
+                       {       operation = "ConvertId";}break;
+                       case ReqCmdGetItem :
+                       {       operation = "GetItem";}break;
+
+                       //Currently unused operations
+
+                       /*case ReqCmdAddDelegate : { operation = "AddDelegate"; } break;
+                        case ReqCmdCopyFolder : { operation = "CopyFolder"; } break;
+                        case ReqCmdCopyItem : { operation = "CopyItem"; } break;
+                        case ReqCmdCreateAttachment : { operation = "CreateAttachment"; } break;
+                        case ReqCmdCreateFolder : { operation = "CreateFolder"; } break;
+                        case ReqCmdCreateItem : { operation = "CreateItem"; } break;
+                        case ReqCmdCreateManagedFolder : { operation = "CreateManagedFolder"; } break;
+                        case ReqCmdDeleteAttachment : { operation = "DeleteAttachment"; } break;
+                        case ReqCmdDeleteFolder : { operation = "DeleteFolder"; } break;
+                        case ReqCmdDeleteItem : { operation = "DeleteItem"; } break;
+                        case ReqCmdExpandDL : { operation = "ExpandDL"; } break;
+                        case ReqCmdFindFolder : { operation = "FindFolder"; } break;
+                        case ReqCmdFindItem : { operation = "FindItem"; } break;
+                        case ReqCmdGetAttachment : { operation = "GetAttachment"; } break;
+                        case ReqCmdGetDelegate : { operation = "GetDelegate"; } break;
+                        case ReqCmdGetEvents : { operation = "GetEvents"; } break;
+                        case ReqCmdGetFolder : { operation = "GetFolder"; } break;
+                        case ReqCmdGetUserOofSettings : { operation = "GetUserOofSettings"; } break;
+                        case ReqCmdMoveFolder : { operation = "MoveFolder"; } break;
+                        case ReqCmdMoveItem : { operation = "MoveItem"; } break;
+                        case ReqCmdRemoveDelegate : { operation = "RemoveDelegate"; } break;
+                        case ReqCmdResolveNames : { operation = "ResolveNames"; } break;
+                        case ReqCmdSendItem : { operation = "SendItem"; } break;
+                        case ReqCmdSetUserOofSettings : { operation = "SetUserOofSettings"; } break;
+                        case ReqCmdSubscribe : { operation = "Subscribe"; } break;
+                        case ReqCmdSyncFolderHierarchy : { operation = "SyncFolderHierarchy"; } break;
+                        case ReqCmdSyncFolderItems : { operation = "SyncFolderItems"; } break;
+                        case ReqCmdUnsubscribe : { operation = "Unsubscribe"; } break;
+                        case ReqCmdUpdateDelegate : { operation = "UpdateDelegate"; } break;
+                        case ReqCmdUpdateFolder : { operation = "UpdateFolder"; } break;
+                        case ReqCmdUpdateItem : { operation = "UpdateItem"; } break;*/
+                       default: break;
                };
 
                if( operation != QString::null )
@@ -472,18 +471,18 @@ QString RequestMessage::getContentTypeForHeader( RequestCommandId aCommandId )
 
 int RequestMessage::createMessageStructure()
 {
-       return createMessageStructure( iCurrCmd );
+       return createMessageStructure(iCurrCmd);
 }
 
-int RequestMessage::createMessageStructure( RequestCommandId aCommandId )
+int RequestMessage::createMessageStructure(RequestCommandId aCommandId)
 {
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::createMessageStructure" );
+       qDebug("RequestMessage::createMessageStructure");
 #endif
-       if( !iMessage )
+       if ( !iMessage)
        {
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::createMessageStructure : iMessage is NULL" );
+               qDebug("RequestMessage::createMessageStructure : iMessage is NULL");
 #endif         
                return MsgErrSomeError;
        }
@@ -491,10 +490,10 @@ int RequestMessage::createMessageStructure( RequestCommandId aCommandId )
        //Should always be soap:Envelope or first element in envelopebase array
        QDomNode last = iMessage->documentElement();
 
-       if( !matchName( last, reqCmdArrayEnvelopeBase[0].iElementName ) )
+       if ( !matchName(last, reqCmdArrayEnvelopeBase[0].iElementName) )
        {
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::createMessageStructure : Document element is not valid SOAP envelope" );
+               qDebug("RequestMessage::createMessageStructure : Document element is not valid SOAP envelope");
 #endif         
                return MsgErrSomeError;
        }
@@ -502,38 +501,60 @@ int RequestMessage::createMessageStructure( RequestCommandId aCommandId )
        QDomNode cmd;
        int err = MsgErrNoError;
 
-       switch( aCommandId )
+       switch (aCommandId)
        {
-       case ReqCmdGetUserAvailability : { cmd = constructArrayToNode( reqCmdArrayGetUserAvailability, sizeof( reqCmdArrayGetUserAvailability ) / sizeof( MessageBodyElement ) ); } break;
-       case ReqCmdConvertId : { cmd = constructArrayToNode( reqCmdArrayConvertId, sizeof( reqCmdArrayConvertId ) / sizeof( MessageBodyElement ) ); } break;
-       case ReqCmdGetItem : { cmd = constructArrayToNode( reqCmdArrayGetCalendarItem, sizeof( reqCmdArrayGetCalendarItem ) / sizeof( MessageBodyElement ) ); } break;
-       default: break;
+               case ReqCmdGetUserAvailability:
+               {
+                       cmd
+                                       = constructArrayToNode(reqCmdArrayGetUserAvailability, sizeof(reqCmdArrayGetUserAvailability )
+                                                       / sizeof(MessageBodyElement));
+               }
+                       break;
+               case ReqCmdConvertId:
+               {
+                       cmd
+                                       = constructArrayToNode(reqCmdArrayConvertId, sizeof(reqCmdArrayConvertId )
+                                                       / sizeof(MessageBodyElement));
+               }
+                       break;
+               case ReqCmdGetItem:
+               {
+                       cmd
+                                       = constructArrayToNode(reqCmdArrayGetCalendarItem, sizeof(reqCmdArrayGetCalendarItem )
+                                                       / sizeof(MessageBodyElement));
+               }
+                       break;
+               default:
+                       break;
        };
 
-       if( cmd.isNull() ) err = MsgErrSomeError;
-       else{
-               err = addNode( cmd, QDomNode::ElementNode, reqCmdArrayEnvelopeBase[0].iElementName );
+       if (cmd.isNull() )
+               err = MsgErrSomeError;
+       else
+       {
+               err
+                               = addNode(cmd, QDomNode::ElementNode, reqCmdArrayEnvelopeBase[0].iElementName);
        }
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::createMessageStructure end : err=%d", err );
+       qDebug("RequestMessage::createMessageStructure end : err=%d", err);
 #endif 
        return err;
 }
 
-QDomNode RequestMessage::constructArrayToNode( const MessageBodyElement* aArray, int aSize )
+QDomNode RequestMessage::constructArrayToNode(const MessageBodyElement* aArray, int aSize)
 {
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::constructArrayToNode" );
+       qDebug("RequestMessage::constructArrayToNode");
 #endif
        QDomElement target; //final node to be returned
 
-       if( !iMessage || aSize == 0 )
-               {
+       if ( !iMessage || aSize == 0)
+       {
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::constructArrayToNode : iMessage is NULL or aSize is 0." );
+               qDebug("RequestMessage::constructArrayToNode : iMessage is NULL or aSize is 0.");
 #endif
                return target;
-               }
+       }
 
        QDomElement last; // last appended node
 
@@ -542,16 +563,16 @@ QDomNode RequestMessage::constructArrayToNode( const MessageBodyElement* aArray,
 
        //get the root
        MessageBodyElement root = aArray[idx];
-       if( root.iNodeType != QDomNode::ElementNode || root.iTraversalLevel > 0 )
+       if (root.iNodeType != QDomNode::ElementNode || root.iTraversalLevel > 0)
        {
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::constructArrayToNode : Malformed message definition. Check array for faults." );
+               qDebug("RequestMessage::constructArrayToNode : Malformed message definition. Check array for faults.");
 #endif         
                return target; //Root must be an element and on level 0
        }
        else
        {
-               if( root.iNamespace != QString::null )
+               if (root.iNamespace != QString::null )
                {
                        //QString prefix = root.iNamespace
                        target = iMessage->createElementNS( root.iNamespace, root.iElementName );
@@ -585,7 +606,7 @@ QDomNode RequestMessage::constructArrayToNode( const MessageBodyElement* aArray,
                                if( currentLvl == 0 )
                                {
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::constructArrayToNode : Malformed message definition. Check array for faults." );
+                                       qDebug( "RequestMessage::constructArrayToNode : Malformed message definition. Check array for faults." );
 #endif                                                 
                                        return target; //Only root can be at traversal level 0
                                }
@@ -593,17 +614,17 @@ QDomNode RequestMessage::constructArrayToNode( const MessageBodyElement* aArray,
                                {
                                        //Sibling to previous
                                        if( !last.parentNode().isNull() )
-                                               last.parentNode().appendChild( elem );
+                                       last.parentNode().appendChild( elem );
                                        else
-                                               {
+                                       {
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::constructArrayToNode : Malformed message definition. Check array for faults." );
+                                               qDebug( "RequestMessage::constructArrayToNode : Malformed message definition. Check array for faults." );
 #endif 
                                                return target; //malformed. if last has no parent, it's a rootnode
-                                               }
+                                       }
                                }
                        }
-                       else if( element.iTraversalLevel > currentLvl )
+                       else if( element.iTraversalLevel> currentLvl )
                        {
                                //check if node is child to previous
                                //else there is something wrong in array representing the structure
@@ -614,7 +635,7 @@ QDomNode RequestMessage::constructArrayToNode( const MessageBodyElement* aArray,
                                else
                                {
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::constructArrayToNode : Malformed message definition. Check array for faults." );
+                                       qDebug( "RequestMessage::constructArrayToNode : Malformed message definition. Check array for faults." );
 #endif 
                                        return target;
                                }
@@ -636,7 +657,7 @@ QDomNode RequestMessage::constructArrayToNode( const MessageBodyElement* aArray,
                        else
                        {
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::constructArrayToNode : Malformed message definition. Check array for faults." );
+                               qDebug( "RequestMessage::constructArrayToNode : Malformed message definition. Check array for faults." );
 #endif                         
                                //some undefined error
                                return target;
@@ -650,9 +671,9 @@ QDomNode RequestMessage::constructArrayToNode( const MessageBodyElement* aArray,
 
                        QDomAttr attr;
                        if( element.iNamespace != QString::null )
-                                attr = iMessage->createAttributeNS( element.iNamespace, element.iElementName );
+                       attr = iMessage->createAttributeNS( element.iNamespace, element.iElementName );
                        else
-                                attr = iMessage->createAttribute( element.iElementName );
+                       attr = iMessage->createAttribute( element.iElementName );
 
                        if( element.iTraversalLevel == currentLvl )
                        {
@@ -661,7 +682,7 @@ QDomNode RequestMessage::constructArrayToNode( const MessageBodyElement* aArray,
                        else
                        {
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::constructArrayToNode : Malformed message definition. Check array for faults." );
+                               qDebug( "RequestMessage::constructArrayToNode : Malformed message definition. Check array for faults." );
 #endif                                 
                                //error in template array.
                                //attributes for element must be specified right after element
@@ -672,7 +693,7 @@ QDomNode RequestMessage::constructArrayToNode( const MessageBodyElement* aArray,
                else
                {
 #ifdef MU_DEBUG
-       qDebug( "RequestMessage::constructArrayToNode : Node type not supported." );
+                       qDebug( "RequestMessage::constructArrayToNode : Node type not supported." );
 #endif 
                        //node type not supported
                        return target;
@@ -692,71 +713,71 @@ QDomNode RequestMessage::constructArrayToNode( const MessageBodyElement* aArray,
 ResponseMessage::ResponseMessage()
 {
 #ifdef MU_DEBUG
-       qDebug( "ResponseMessage::ResponseMessage" );
+       qDebug("ResponseMessage::ResponseMessage");
 #endif
        iMessage = new QDomDocument();
 #ifdef MU_DEBUG
-       qDebug( "ResponseMessage::ResponseMessage end" );
+       qDebug("ResponseMessage::ResponseMessage end");
 #endif
 }
 
-ResponseMessage::ResponseMessage( const QByteArray& aData )
+ResponseMessage::ResponseMessage(const QByteArray& aData)
 {
 #ifdef MU_DEBUG
-       qDebug( "ResponseMessage::ResponseMessage" );
+       qDebug("ResponseMessage::ResponseMessage");
 #endif
-       iMessage->setContent( aData, true );
+       iMessage->setContent(aData, true);
 #ifdef MU_DEBUG
-       qDebug( "ResponseMessage::ResponseMessage end" );
+       qDebug("ResponseMessage::ResponseMessage end");
 #endif
 }
 
-QString ResponseMessage::getNodeValue( const QString& aNodeName, QDomNode::NodeType aNodeType, const QString& aParentName, int aIndex, QDomNode* aRootNode )
+QString ResponseMessage::getNodeValue(const QString& aNodeName, QDomNode::NodeType aNodeType, const QString& aParentName, int aIndex, QDomNode* aRootNode)
 {
 #ifdef MU_DEBUG
-       qDebug( "ResponseMessage::getNodeValue" );
+       qDebug("ResponseMessage::getNodeValue");
 #endif 
        QString value = QString::null;
        QDomNode node = getNodeFromDocument( aNodeName, aNodeType, aParentName, aIndex, aRootNode );
        if( !node.isNull() )
        {
                if( node.isElement() )
-                       value = node.toElement().text();
+               value = node.toElement().text();
                else if( node.isAttr() )
-                       value = node.toAttr().value();
+               value = node.toAttr().value();
        }
 #ifdef MU_DEBUG
        qDebug( "ResponseMessage::getNodeValue end" );
 #endif 
-       return value;   
+       return value;
 }
 
 bool ResponseMessage::hasErrors()
 {
 #ifdef MU_DEBUG
-       qDebug( "ResponseMessage::hasErrors" );
+       qDebug("ResponseMessage::hasErrors");
 #endif
-       if( !iMessage )
-               {
+       if ( !iMessage)
+       {
 #ifdef MU_DEBUG
-       qDebug( "ResponseMessage::hasErrors : iMessage is NULL." );
+               qDebug("ResponseMessage::hasErrors : iMessage is NULL.");
 #endif
                return true;
-               }
+       }
 
        QDomElement root = iMessage->documentElement();
        bool err = false;
 
-       QString rootname = ( root.prefix() == QString::null ) ? root.tagName() : root.localName();
+       QString rootname = (root.prefix() == QString::null ) ? root.tagName() : root.localName();
        err = ( rootname.compare( QString( "Envelope" ) ) == 0 ) ? false : true;
 
        QDomNodeList list = iMessage->elementsByTagName( QString( "m:ResponseCode" ) );
        for( int i=0; i<list.count(); i++ )
        {
                if( list.item(i).nodeValue().compare( "NoError" ) != 0 )
-                       {
+               {
                        err = true;
-                       }
+               }
        }
 #ifdef MU_DEBUG
        qDebug( "ResponseMessage::hasErrors end : err=%d", err );
@@ -768,90 +789,93 @@ bool ResponseMessage::hasErrors()
  * ReqMsgGetUserAvailability class functions
  */
 
-ReqMsgGetUserAvailability::ReqMsgGetUserAvailability() : RequestMessage( ReqCmdGetUserAvailability )
+ReqMsgGetUserAvailability::ReqMsgGetUserAvailability() :
+       RequestMessage(ReqCmdGetUserAvailability)
 {
 #ifdef MU_DEBUG
-       qDebug( "ReqMsgGetUserAvailability::ReqMsgGetUserAvailability" );
+       qDebug("ReqMsgGetUserAvailability::ReqMsgGetUserAvailability");
 #endif
-       if( iMessage && iCurrCmd == ReqCmdGetUserAvailability )
+       if (iMessage && iCurrCmd == ReqCmdGetUserAvailability)
        {
-               setNodeValue( QString( "MergedFreeBusyIntervalInMinutes" ), QString::number( 60 ) );
-               setNodeValue( QString( "RequestedView" ), QString( "DetailedMerged" ) );
+               setNodeValue(QString("MergedFreeBusyIntervalInMinutes"), QString::number( 60) );
+               setNodeValue(QString("RequestedView"), QString("DetailedMerged") );
        }
 #ifdef MU_DEBUG
-       qDebug( "ReqMsgGetUserAvailability::ReqMsgGetUserAvailability end" );
+       qDebug("ReqMsgGetUserAvailability::ReqMsgGetUserAvailability end");
 #endif 
 }
 
-int ReqMsgGetUserAvailability::addUser( const QString& aAddress, const QString& /*aAttendeeType*/, const QString& aExcludeConflicts )
+int ReqMsgGetUserAvailability::addUser(const QString& aAddress, const QString& /*aAttendeeType*/, const QString& aExcludeConflicts)
 {
 #ifdef MU_DEBUG
-       qDebug( "ReqMsgGetUserAvailability::addUser" );
+       qDebug("ReqMsgGetUserAvailability::addUser");
 #endif
-       if( !iMessage || iCurrCmd != ReqCmdGetUserAvailability )
+       if ( !iMessage || iCurrCmd != ReqCmdGetUserAvailability)
        {
 #ifdef MU_DEBUG
-       qDebug( "ReqMsgGetUserAvailability::addUser : iMessage is NULL or current command id is wrong" );
+               qDebug("ReqMsgGetUserAvailability::addUser : iMessage is NULL or current command id is wrong");
 #endif         
                return MsgErrSomeError;
        }
 
        int err = MsgErrNoError;
-       int size = sizeof( reqCmdMailboxElement ) / sizeof( MessageBodyElement );
+       int size = sizeof(reqCmdMailboxElement ) / sizeof(MessageBodyElement);
 
        //Create mailbox data element
-       QDomNode mailbox = constructArrayToNode( reqCmdMailboxElement, size );
-       if( !mailbox.isNull() )
+       QDomNode mailbox = constructArrayToNode(reqCmdMailboxElement, size);
+       if ( !mailbox.isNull() )
        {
                QDomNode email;
 
-               if( mailbox.hasChildNodes() )
+               if (mailbox.hasChildNodes() )
                {
-                       for ( QDomNode subnode = mailbox.firstChild(); !subnode.isNull(); subnode = subnode.nextSibling() )
+                       for (QDomNode subnode = mailbox.firstChild(); !subnode.isNull(); subnode
+                                       = subnode.nextSibling() )
                        {
-                               qDebug( "subnode: %s", subnode.toElement().tagName().toStdString().data() );
-                               if( matchName( subnode, QString( "Email" ) ) )
-                                       {
+                               qDebug("subnode: %s", subnode.toElement().tagName().toStdString().data() );
+                               if (matchName(subnode, QString("Email") ) )
+                               {
                                        email = subnode;
-                                       }
+                               }
                        }
                }
 
-               setNodeValue( QString( "Address" ), aAddress, QDomNode::ElementNode, QString( "Email" ), 0, &email );
-               setNodeValue( QString( "AttendeeType" ), QString( "Required" ), QDomNode::ElementNode, QString( "MailboxData" ), 0, &mailbox );
-               setNodeValue( QString( "ExcludeConflicts" ), aExcludeConflicts, QDomNode::ElementNode, QString( "MailboxData" ), 0, &mailbox );
+               setNodeValue(QString("Address"), aAddress, QDomNode::ElementNode, QString("Email"), 0, &email);
+               setNodeValue(QString("AttendeeType"), QString("Required"), QDomNode::ElementNode, QString("MailboxData"), 0, &mailbox);
+               setNodeValue(QString("ExcludeConflicts"), aExcludeConflicts, QDomNode::ElementNode, QString("MailboxData"), 0, &mailbox);
 
-               err = addNode( mailbox, QDomNode::ElementNode, QString( "MailboxDataArray" ) );
+               err
+                               = addNode(mailbox, QDomNode::ElementNode, QString("MailboxDataArray") );
        }
        else
                err = MsgErrSomeError;
 
 #ifdef MU_DEBUG
-       qDebug( "ReqMsgGetUserAvailability::addUser end : err=%d", err );
+       qDebug("ReqMsgGetUserAvailability::addUser end : err=%d", err);
 #endif 
        return err;
 }
 
-int ReqMsgGetUserAvailability::setTimeWindow( const QDateTime& aStart, const QDateTime& aEnd )
+int ReqMsgGetUserAvailability::setTimeWindow(const QDateTime& aStart, const QDateTime& aEnd)
 {
 #ifdef MU_DEBUG
-       qDebug( "ReqMsgGetUserAvailability::setTimeWindow" );
+       qDebug("ReqMsgGetUserAvailability::setTimeWindow");
 #endif
-       if( !iMessage || iCurrCmd != ReqCmdGetUserAvailability )
+       if ( !iMessage || iCurrCmd != ReqCmdGetUserAvailability)
        {
 #ifdef MU_DEBUG
-       qDebug( "ReqMsgGetUserAvailability::setTimeWindow : iMessage is NULL or command id is wrong" );
+               qDebug("ReqMsgGetUserAvailability::setTimeWindow : iMessage is NULL or command id is wrong");
 #endif         
                return MsgErrSomeError;
        }
 
        int err = MsgErrNoError;
 
-       err = setNodeValue( QString( "StartTime" ), aStart.toString( Qt::ISODate ) );
-       err = setNodeValue( QString( "EndTime" ), aEnd.toString( Qt::ISODate ) );
+       err = setNodeValue(QString("StartTime"), aStart.toString(Qt::ISODate) );
+       err = setNodeValue(QString("EndTime"), aEnd.toString(Qt::ISODate) );
 
 #ifdef MU_DEBUG
-       qDebug( "ReqMsgGetUserAvailability::setTimeWindow end : err=%d", err );
+       qDebug("ReqMsgGetUserAvailability::setTimeWindow end : err=%d", err);
 #endif         
        return err;
 }
@@ -859,12 +883,12 @@ int ReqMsgGetUserAvailability::setTimeWindow( const QDateTime& aStart, const QDa
 int ReqMsgGetUserAvailability::setTimeZone()
 {
 #ifdef MU_DEBUG
-       qDebug( "ReqMsgGetUserAvailability::setTimeZone" );
+       qDebug("ReqMsgGetUserAvailability::setTimeZone");
 #endif
-       if( !iMessage || iCurrCmd != ReqCmdGetUserAvailability )
+       if ( !iMessage || iCurrCmd != ReqCmdGetUserAvailability)
        {
 #ifdef MU_DEBUG
-       qDebug( "ReqMsgGetUserAvailability::setTimeZone : iMessage is NULL or command id is wrong" );
+               qDebug("ReqMsgGetUserAvailability::setTimeZone : iMessage is NULL or command id is wrong");
 #endif         
                return MsgErrSomeError;
        }
@@ -875,33 +899,34 @@ int ReqMsgGetUserAvailability::setTimeZone()
 
        time(&rawtime);
        localTime = localtime(&rawtime);
-       
+
        int offsetMinutes = localTime->tm_gmtoff / 60;
        if (localTime->tm_isdst)
-               offsetMinutes -= 60;    // If DST is in use then reduce an hour from offset, because
-                                                               // DST will be added to the offset later and it already includes
-                                                               // DST. TODO: This is silly and must be changed if possible.
-                                                               // If you can get UTC offset without DST, use it here.
-       
+               offsetMinutes -= 60; // If DST is in use then reduce an hour from offset, because
+       // DST will be added to the offset later and it already includes
+       // DST. TODO: This is silly and must be changed if possible.
+       // If you can get UTC offset without DST, use it here.
+
 #ifdef MU_DEBUG
-       qDebug( "ReqMsgGetUserAvailability::setTimeZone - offset in minutes=%d", offsetMinutes );
+       qDebug("ReqMsgGetUserAvailability::setTimeZone - offset in minutes=%d", offsetMinutes);
 #endif
-       
-       //TODO: timezone and daylight times to application configuration
-       setNodeValue( QString( "Bias" ), QString::number( -offsetMinutes ), QDomNode::ElementNode, QString( "TimeZone" ) );
-       setNodeValue( QString( "Bias" ), QString::number( 0 ), QDomNode::ElementNode, QString( "StandardTime" ) );
-       setNodeValue( QString( "Time" ), QString( "03:00:00" ), QDomNode::ElementNode, QString( "StandardTime" ) );
-       setNodeValue( QString( "DayOrder" ), QString::number( 5 ), QDomNode::ElementNode, QString( "StandardTime" ) );
-       setNodeValue( QString( "Month" ), QString::number( 10 ), QDomNode::ElementNode, QString( "StandardTime" ) );
-       setNodeValue( QString( "DayOfWeek" ), QString( "Sunday" ), QDomNode::ElementNode, QString( "StandardTime" ) );
-       setNodeValue( QString( "Bias" ), QString::number( -60 ), QDomNode::ElementNode, QString( "DaylightTime" ) );
-       setNodeValue( QString( "Time" ), QString( "03:00:00" ), QDomNode::ElementNode, QString( "DaylightTime" ) );
-       setNodeValue( QString( "DayOrder" ), QString::number( 1 ), QDomNode::ElementNode, QString( "DaylightTime" ) );
-       setNodeValue( QString( "Month" ), QString::number( 4 ), QDomNode::ElementNode, QString( "DaylightTime" ) );
-       setNodeValue( QString( "DayOfWeek" ), QString( "Sunday" ), QDomNode::ElementNode, QString( "DaylightTime" ) );
-
-#ifdef MU_DEBUG
-       qDebug( "ReqMsgGetUserAvailability::setTimeZone end : err=%d", err );
+
+        DateTimeSettings *dateTimeSettings = Configuration::instance()->dateTimeSettings();
+        
+        setNodeValue( QString( "Bias" ), QString::number( -offsetMinutes ), QDomNode::ElementNode, QString( "TimeZone" ) );
+        setNodeValue( QString( "Bias" ), QString::number( 0 ), QDomNode::ElementNode, QString( "StandardTime" ) );
+        setNodeValue( QString( "Time" ), dateTimeSettings->STDTime(), QDomNode::ElementNode, QString( "StandardTime" ) );
+        setNodeValue( QString( "DayOrder" ), dateTimeSettings->STDDay(), QDomNode::ElementNode, QString( "StandardTime" ) );
+        setNodeValue( QString( "Month" ), dateTimeSettings->STDMonth(), QDomNode::ElementNode, QString( "StandardTime" ) );
+        setNodeValue( QString( "DayOfWeek" ), dateTimeSettings->switchDay(), QDomNode::ElementNode, QString( "StandardTime" ) );
+        setNodeValue( QString( "Bias" ), QString::number( -60 ), QDomNode::ElementNode, QString( "DaylightTime" ) );
+        setNodeValue( QString( "Time" ), dateTimeSettings->DSTTime(), QDomNode::ElementNode, QString( "DaylightTime" ) );
+        setNodeValue( QString( "DayOrder" ), dateTimeSettings->DSTDay(), QDomNode::ElementNode, QString( "DaylightTime" ) );
+        setNodeValue( QString( "Month" ), dateTimeSettings->DSTMonth(), QDomNode::ElementNode, QString( "DaylightTime" ) );
+        setNodeValue( QString( "DayOfWeek" ), dateTimeSettings->switchDay(), QDomNode::ElementNode, QString( "DaylightTime" ) );
+
+#ifdef MU_DEBUG
+       qDebug("ReqMsgGetUserAvailability::setTimeZone end : err=%d", err);
 #endif         
        return err;
 }
@@ -909,65 +934,74 @@ int ReqMsgGetUserAvailability::setTimeZone()
 /*
  * ReqMsgConvertMeetingId class functions
  */
-ReqMsgConvertMeetingId::ReqMsgConvertMeetingId( const QString& aItemId, const QString& aMailbox )
+ReqMsgConvertMeetingId::ReqMsgConvertMeetingId(const QString& aItemId, const QString& aMailbox)
 {
 #ifdef MU_DEBUG
-       qDebug( "ReqMsgConvertMeetingId::ReqMsgConvertMeetingId" );
+       qDebug("ReqMsgConvertMeetingId::ReqMsgConvertMeetingId");
 #endif 
        //For this class, we're not going to provide id for base class as parameter,
        //because before content structure initialization, we must add SOAP header to envelope
        iCurrCmd = ReqCmdConvertId;
-       
-       QDomNode header = constructArrayToNode( reqCmdArrayConvertIdHeader, sizeof( reqCmdArrayConvertIdHeader ) / sizeof( MessageBodyElement ) );
-       
-       if( !header.isNull() )
+
+       QDomNode
+                       header =
+                                       constructArrayToNode(reqCmdArrayConvertIdHeader, sizeof(reqCmdArrayConvertIdHeader )
+                                                       / sizeof(MessageBodyElement));
+
+       if ( !header.isNull() )
        {
-               int err = addNode( header, QDomNode::ElementNode, reqCmdArrayEnvelopeBase[0].iElementName );
+               int
+                               err =
+                                               addNode(header, QDomNode::ElementNode, reqCmdArrayEnvelopeBase[0].iElementName);
 
-               if( err == MsgErrNoError )
+               if (err == MsgErrNoError)
                {
-               createMessageStructure( ReqCmdConvertId );
-               
-               if( aItemId != QString::null ) setItemId( aItemId );
-               if( aMailbox != QString::null ) setMailbox( aMailbox );
-               
-               setNodeValue( QString( "Version" ), QString( "Exchange2007_SP1" ), QDomNode::AttributeNode, QString( "RequestServerVersion" ) );
-               setNodeValue( QString( "DestinationFormat" ), QString( "EwsLegacyId" ), QDomNode::AttributeNode, QString( "ConvertId" ) );
-               setNodeValue( QString( "Format" ), QString( "HexEntryId" ), QDomNode::AttributeNode, QString( "AlternateId" ) );
+                       createMessageStructure(ReqCmdConvertId);
+
+                       if (aItemId != QString::null ) setItemId( aItemId );
+                       if( aMailbox != QString::null ) setMailbox( aMailbox );
+
+                       setNodeValue( QString( "Version" ), QString( "Exchange2007_SP1" ), QDomNode::AttributeNode, QString( "RequestServerVersion" ) );
+                       setNodeValue( QString( "DestinationFormat" ), QString( "EwsLegacyId" ), QDomNode::AttributeNode, QString( "ConvertId" ) );
+                       setNodeValue( QString( "Format" ), QString( "HexEntryId" ), QDomNode::AttributeNode, QString( "AlternateId" ) );
                }
        }
        //setNodeValue( QString( "xmlns:t" ), NS_T, QDomNode::AttributeNode, QString( "ConvertId" ) );
-       
+
        //Must be added (for now at least) like this, because Envelope is initialized already, without attributes
        /*QDomAttr attr = iMessage->createAttribute( QString( "xmlns:t" ) );
-       attr.setValue( NS_T );
-       addNode( attr, QDomNode::AttributeNode, QString( "Envelope" ) );
-       */
+        attr.setValue( NS_T );
+        addNode( attr, QDomNode::AttributeNode, QString( "Envelope" ) );
+        */
 #ifdef MU_DEBUG
        qDebug( "ReqMsgConvertMeetingId::ReqMsgConvertMeetingId end" );
 #endif         
 }
 
-int ReqMsgConvertMeetingId::setItemId( const QString& aItemId )
+int ReqMsgConvertMeetingId::setItemId(const QString& aItemId)
 {
 #ifdef MU_DEBUG
-       qDebug( "ReqMsgConvertMeetingId::setItemId" );
+       qDebug("ReqMsgConvertMeetingId::setItemId");
 #endif 
-       int err = setNodeValue( QString( "Id" ), aItemId, QDomNode::AttributeNode, QString( "AlternateId" ) );
+       int
+                       err =
+                                       setNodeValue(QString("Id"), aItemId, QDomNode::AttributeNode, QString("AlternateId") );
 #ifdef MU_DEBUG
-       qDebug( "ReqMsgConvertMeetingId::setItemId end : err=%d", err );
+       qDebug("ReqMsgConvertMeetingId::setItemId end : err=%d", err);
 #endif 
        return err;
 }
 
-int ReqMsgConvertMeetingId::setMailbox( const QString& aMailbox )
+int ReqMsgConvertMeetingId::setMailbox(const QString& aMailbox)
 {
 #ifdef MU_DEBUG
-       qDebug( "ReqMsgConvertMeetingId::setMailbox" );
+       qDebug("ReqMsgConvertMeetingId::setMailbox");
 #endif 
-       int err = setNodeValue( QString( "Mailbox" ), aMailbox, QDomNode::AttributeNode, QString( "AlternateId" ) );
+       int
+                       err =
+                                       setNodeValue(QString("Mailbox"), aMailbox, QDomNode::AttributeNode, QString("AlternateId") );
 #ifdef MU_DEBUG
-       qDebug( "ReqMsgConvertMeetingId::setMailbox end : err=%d", err );
+       qDebug("ReqMsgConvertMeetingId::setMailbox end : err=%d", err);
 #endif
        return err;
 }
@@ -975,31 +1009,34 @@ int ReqMsgConvertMeetingId::setMailbox( const QString& aMailbox )
 /*
  * ReqMsgGetCalendarItem class functions
  */
-ReqMsgGetCalendarItem::ReqMsgGetCalendarItem( const QString& aItemId ) : RequestMessage( ReqCmdGetItem )
+ReqMsgGetCalendarItem::ReqMsgGetCalendarItem(const QString& aItemId) :
+       RequestMessage(ReqCmdGetItem)
 {
 #ifdef MU_DEBUG
-       qDebug( "ReqMsgGetCalendarItem::ReqMsgGetCalendarItem" );
+       qDebug("ReqMsgGetCalendarItem::ReqMsgGetCalendarItem");
 #endif 
-       if( iMessage && iCurrCmd == ReqCmdGetItem )
+       if (iMessage && iCurrCmd == ReqCmdGetItem)
        {
-               setNodeValue( QString( "BaseShape" ), QString( "AllProperties" ) );
-               
-               if( aItemId != QString::null )
-                       setItemId( aItemId );
+               setNodeValue(QString("BaseShape"), QString("AllProperties") );
+
+               if (aItemId != QString::null )
+               setItemId( aItemId );
        }
 #ifdef MU_DEBUG
        qDebug( "ReqMsgGetCalendarItem::ReqMsgGetCalendarItem end" );
 #endif
 }
 
-int ReqMsgGetCalendarItem::setItemId( const QString& aItemId )
+int ReqMsgGetCalendarItem::setItemId(const QString& aItemId)
 {
 #ifdef MU_DEBUG
-       qDebug( "ReqMsgGetCalendarItem::setItemId" );
+       qDebug("ReqMsgGetCalendarItem::setItemId");
 #endif 
-       int err = setNodeValue( QString( "Id" ), aItemId, QDomNode::AttributeNode, QString( "ItemId" ), 0 );
+       int
+                       err =
+                                       setNodeValue(QString("Id"), aItemId, QDomNode::AttributeNode, QString("ItemId"), 0);
 #ifdef MU_DEBUG
-       qDebug( "ReqMsgGetCalendarItem::setItemId end : err=%d", err );
+       qDebug("ReqMsgGetCalendarItem::setItemId end : err=%d", err);
 #endif 
        return err;
 }
@@ -1007,137 +1044,141 @@ int ReqMsgGetCalendarItem::setItemId( const QString& aItemId )
 /*
  * ResMsgGetUserAvailability class functions
  */
-ResMsgGetUserAvailability::ResMsgGetUserAvailability( const QByteArray& aData ) : ResponseMessage( aData )
+ResMsgGetUserAvailability::ResMsgGetUserAvailability(const QByteArray& aData) :
+       ResponseMessage(aData)
 {
 #ifdef MU_DEBUG
-       qDebug( "ResMsgGetUserAvailability::ResMsgGetUserAvailability" );
-       qDebug( "ResMsgGetUserAvailability::ResMsgGetUserAvailability end" );
+       qDebug("ResMsgGetUserAvailability::ResMsgGetUserAvailability");
+       qDebug("ResMsgGetUserAvailability::ResMsgGetUserAvailability end");
 #endif
 }
 
-int ResMsgGetUserAvailability::getMeetingsFromResponse( QList<Meeting*>& aMeetings, const Room &aRoom )
+int ResMsgGetUserAvailability::getMeetingsFromResponse(QList<Meeting*>& aMeetings, const Room &aRoom)
 {
 #ifdef MU_DEBUG
-       qDebug( "ResMsgGetUserAvailability::getMeetingsFromResponse" );
+       qDebug("ResMsgGetUserAvailability::getMeetingsFromResponse");
 #endif
-               if( !iMessage )
-                       {
+       if ( !iMessage)
+       {
 #ifdef MU_DEBUG
-       qDebug( "ResMsgGetUserAvailability::getMeetingsFromResponse : iMessage is NULL" );
+               qDebug("ResMsgGetUserAvailability::getMeetingsFromResponse : iMessage is NULL");
 #endif 
-                       return MsgErrSomeError;
-                       }
+               return MsgErrSomeError;
+       }
 
-               //TODO: Clean this function a bit (see getMeetingDetailsFromResponse)
-               
-               int err = MsgErrNoError;
+       //TODO: Clean this function a bit (see getMeetingDetailsFromResponse)
 
-               QDomNodeList list = iMessage->elementsByTagName( QString( "CalendarEvent" ) );
+       int err = MsgErrNoError;
 
-               for( int i=0; i<list.count(); i++ )
+       QDomNodeList list = iMessage->elementsByTagName(QString("CalendarEvent") );
+
+       for (int i=0; i<list.count(); i++)
+       {
+               QDomElement e = list.item( i ).toElement();
+               QString tagName = (e.prefix() == QString::null ) ? e.tagName().toLower() : e.localName().toLower();
+
+               if( !e.isNull() && tagName == "calendarevent" )
                {
-                       QDomElement e = list.item( i ).toElement();
-                       QString tagName = ( e.prefix() == QString::null ) ? e.tagName().toLower() : e.localName().toLower();
 
-                       if( !e.isNull() && tagName == "calendarevent" )
-                       {
+                       QString id, startsAt, endsAt, organizer, subject;
 
-                               QString id, startsAt, endsAt, organizer, subject;
+                       for ( QDomNode subnode = e.firstChild(); !subnode.isNull(); subnode = subnode.nextSibling() )
+                       {
+                               QDomElement e = subnode.toElement();
+                               QString tagName = ( e.prefix() == QString::null ) ? e.tagName().toLower() : e.localName().toLower();
 
-                               for ( QDomNode subnode = e.firstChild(); !subnode.isNull(); subnode = subnode.nextSibling() )
+                               if( tagName == QString( "starttime" ) )
+                               {
+                                       startsAt = e.text();
+                               }
+                               else if( tagName == QString( "endtime" ) )
+                               {
+                                       endsAt = e.text();
+                               }
+                               else if( tagName == QString( "calendareventdetails" ) )
                                {
-                                       QDomElement e = subnode.toElement();
-                                       QString tagName = ( e.prefix() == QString::null ) ? e.tagName().toLower() : e.localName().toLower();
 
-                                       if( tagName == QString( "starttime" ) )
-                                       {
-                                               startsAt = e.text();
-                                       }
-                                       else if( tagName == QString( "endtime" ) )
+                                       for ( QDomNode detailnode = subnode.firstChild(); !detailnode.isNull(); detailnode = detailnode.nextSibling() )
                                        {
-                                               endsAt = e.text();
-                                       }
-                                       else if( tagName == QString( "calendareventdetails" ) )
-                                       {
-
-                                               for ( QDomNode detailnode = subnode.firstChild(); !detailnode.isNull(); detailnode = detailnode.nextSibling() )
-                                               {
 
-                                                       QDomElement e = detailnode.toElement();
-                                                       QString tagName = ( e.prefix() == QString::null ) ? e.tagName().toLower() : e.localName().toLower();
+                                               QDomElement e = detailnode.toElement();
+                                               QString tagName = ( e.prefix() == QString::null ) ? e.tagName().toLower() : e.localName().toLower();
 
-                                                       if( tagName == QString( "id" ) )
-                                                       {                                                       
-                                                               id = e.text();
-                                                       }
+                                               if( tagName == QString( "id" ) )
+                                               {
+                                                       id = e.text();
+                                               }
 
-                                                       if( tagName == QString( "subject" ) )
-                                                       {
-                                                               subject = e.text();
-                                                       }
+                                               if( tagName == QString( "subject" ) )
+                                               {
+                                                       subject = e.text();
                                                }
                                        }
                                }
+                       }
 
-                               QDateTime start = QDateTime::fromString( startsAt, Qt::ISODate );
-                               QDateTime end = QDateTime::fromString( endsAt, Qt::ISODate );
+                       QDateTime start = QDateTime::fromString( startsAt, Qt::ISODate );
+                       QDateTime end = QDateTime::fromString( endsAt, Qt::ISODate );
 
-                               aMeetings.append( new Meeting(
-                                               id,
-                                               aRoom,
-                                               start,
-                                               end,
-                                               subject ) );
+                       aMeetings.append( new Meeting(
+                                       id,
+                                       aRoom,
+                                       start,
+                                       end,
+                                       subject ) );
 
-                       }
                }
+       }
 #ifdef MU_DEBUG
        qDebug( "ResMsgGetUserAvailability::getMeetingsFromResponse end : err=%d", err );
 #endif         
-               return err;
+       return err;
 }
 
 /*
  * ResMsgGetCalendarItem class functions
  */
-int ResMsgGetCalendarItem::getMeetingDetailsFromResponse( Meeting& aMeeting )
+int ResMsgGetCalendarItem::getMeetingDetailsFromResponse(Meeting& aMeeting)
 {
 #ifdef MU_DEBUG
-       qDebug( "ResMsgGetCalendarItem::getMeetingDetailsFromResponse" );
+       qDebug("ResMsgGetCalendarItem::getMeetingDetailsFromResponse");
 #endif
-       if( !iMessage || hasErrors() )
-               {
+       if ( !iMessage || hasErrors() )
+       {
 #ifdef MU_DEBUG
-       qDebug( "ResMsgGetCalendarItem::getMeetingDetailsFromResponse : iMessage is NULL or response has errors." );
+               qDebug("ResMsgGetCalendarItem::getMeetingDetailsFromResponse : iMessage is NULL or response has errors.");
 #endif         
                return MsgErrSomeError;
-               }
+       }
 
        QString name, address, description; //Organizer
 
-       QDomNode box = getElementFromDocument( QString( "Mailbox" ), QString( "Organizer" ), 0 );
+       QDomNode box =
+                       getElementFromDocument(QString("Mailbox"), QString("Organizer"), 0);
 
-       if( !box.isNull() && box.hasChildNodes() )
+       if ( !box.isNull() && box.hasChildNodes() )
        {
-               for ( QDomNode subnode = box.firstChild(); !subnode.isNull(); subnode = subnode.nextSibling() )
+               for (QDomNode subnode = box.firstChild(); !subnode.isNull(); subnode
+                               = subnode.nextSibling() )
                {
-                       if( matchName( subnode, QString( "Name" ) ) )
+                       if (matchName(subnode, QString("Name") ) )
                                name = subnode.toElement().text();
-                       else if( matchName( subnode, QString( "EmailAddress" ) ) )
+                       else if (matchName(subnode, QString("EmailAddress") ) )
                                address = subnode.toElement().text();
                }
        }
-       
-       QDomNode body = getElementFromDocument( QString( "Body" ), QString( "CalendarItem" ), 0 );
 
-       if( body.isElement() )
+       QDomNode body =
+                       getElementFromDocument(QString("Body"), QString("CalendarItem"), 0);
+
+       if (body.isElement() )
                description = body.toElement().text();
-       
-       aMeeting.setOrganizer( name, address );
-       aMeeting.setDescription( description );
+
+       aMeeting.setOrganizer(name, address);
+       aMeeting.setDescription(description);
 
 #ifdef MU_DEBUG
-       qDebug( "ResMsgGetCalendarItem::getMeetingDetailsFromResponse end" );
+       qDebug("ResMsgGetCalendarItem::getMeetingDetailsFromResponse end");
 #endif         
        return MsgErrNoError;
 }
index 60d9253..6573e28 100644 (file)
@@ -141,6 +141,7 @@ void RoomStatusIndicatorWidget::statusChanged( const Room::Status aStatus, const
 \r
 void RoomStatusIndicatorWidget::connectionEstablished()\r
 {\r
+       \r
        if( !connectedOnce )\r
        {\r
                // Just got the required meetings for the first time\r
@@ -149,6 +150,7 @@ void RoomStatusIndicatorWidget::connectionEstablished()
                iUntilTextLabel->setHidden( false );\r
                iStatusLabel->setHidden( false );\r
        }\r
+       else qDebug() << "RoomStatusIndicatorWidget::connectionEstablished()";\r
        ViewBase::connectionEstablished();\r
        iConnectionLabel->setHidden( true );\r
 }\r
index 902f177..14c51aa 100644 (file)
@@ -12,7 +12,8 @@
 
 ViewBase::ViewBase( ViewBase::ViewMode aMode, QWidget *aParent ) : QWidget( aParent ), iViewMode( aMode )
 {
-
+       connectedOnce = false;
+       connectionError = false;
 }
 
 ViewBase::~ViewBase()