Settings view fixed.
[qtmeetings] / src / Domain / Configuration / Configuration.cpp
index 0076e23..54648ca 100644 (file)
@@ -159,17 +159,38 @@ void Configuration::saveConnectionSettings( const QDomNode &aXML )
                if ( tagName == QString( "serverurl" ) )
                {
                        QDomText t = node.ownerDocument().createTextNode( iConnectionSettings->serverUrl().toString() );
-                       e.replaceChild( t, e.firstChild() );
+                       if ( e.hasChildNodes() )
+                       {
+                               e.replaceChild( t, e.firstChild() );
+                       }
+                       else
+                       {
+                               e.appendChild( e.firstChild() );
+                       }
                }
                else if ( tagName == QString( "username" ) )
                {
                        QDomText t = node.ownerDocument().createTextNode( iConnectionSettings->username() );
-                       e.replaceChild( t, e.firstChild() );
+                       if ( e.hasChildNodes() )
+                       {
+                               e.replaceChild( t, e.firstChild() );
+                       }
+                       else
+                       {
+                               e.appendChild( e.firstChild() );
+                       }
                }
                else if ( tagName == QString( "password" ) )
                {
                        QDomText t = node.ownerDocument().createTextNode( iConnectionSettings->password() );
-                       e.replaceChild( t, e.firstChild() );
+                       if ( e.hasChildNodes() )
+                       {
+                               e.replaceChild( t, e.firstChild() );
+                       }
+                       else
+                       {
+                               e.appendChild( e.firstChild() );
+                       }
                }
                else if ( tagName == QString( "refreshinterval" ) )
                {
@@ -198,6 +219,7 @@ void Configuration::saveRooms( const QDomNode &aXML )
                node = next;
        }
 
+       node = aXML;
        QList<Room*>::iterator i;
        for ( i = iRooms.begin(); i != iRooms.end(); ++i )
        {
@@ -619,7 +641,7 @@ DateTimeSettings * Configuration::readDateTimeSettings( const QDomNode &aXML )
                        
                        bool success = false;
                        unsigned int weekDayTmp = e.text().toUInt( &success );
-                       if( success && weekDayTmp >= 0 && weekDayTmp < 7)
+                       if( success && weekDayTmp < 7 )
                        {
                                dayOfWeek = (DateTimeSettings::weekDay)weekDayTmp;
                        }