X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2FDomain%2FConfiguration%2FConfiguration.cpp;fp=src%2FDomain%2FConfiguration%2FConfiguration.cpp;h=2a3399827680bd0a5bed1f706e28ecb1f5558a39;hb=a85316b005e03207e250a47aae018cfcd15c7bc7;hp=9872192283a2bb98034c42f364f041826d832647;hpb=3c019b17cf2052d8fe5bdfc04a986c520ff409e7;p=qtmeetings diff --git a/src/Domain/Configuration/Configuration.cpp b/src/Domain/Configuration/Configuration.cpp index 9872192..2a33998 100644 --- a/src/Domain/Configuration/Configuration.cpp +++ b/src/Domain/Configuration/Configuration.cpp @@ -158,37 +158,37 @@ void Configuration::saveConnectionSettings( const QDomNode &aXML ) if ( tagName == QString( "serverurl" ) ) { QDomText t = node.ownerDocument().createTextNode( iConnectionSettings->serverUrl().toString() ); - if ( e.childNodes().length() == 0 ) + if ( e.hasChildNodes() ) { - e.appendChild( t ); + e.replaceChild( t, e.firstChild() ); } else { - e.replaceChild( t, e.firstChild() ); + e.appendChild( e.firstChild() ); } } else if ( tagName == QString( "username" ) ) { QDomText t = node.ownerDocument().createTextNode( iConnectionSettings->username() ); - if ( e.childNodes().length() == 0 ) + if ( e.hasChildNodes() ) { - e.appendChild( t ); + e.replaceChild( t, e.firstChild() ); } else { - e.replaceChild( t, e.firstChild() ); + e.appendChild( e.firstChild() ); } } else if ( tagName == QString( "password" ) ) { QDomText t = node.ownerDocument().createTextNode( iConnectionSettings->password() ); - if ( e.childNodes().length() == 0 ) + if ( e.hasChildNodes() ) { - e.appendChild( t ); + e.replaceChild( t, e.firstChild() ); } else { - e.replaceChild( t, e.firstChild() ); + e.appendChild( e.firstChild() ); } } else if ( tagName == QString( "refreshinterval" ) ) @@ -202,7 +202,6 @@ void Configuration::saveConnectionSettings( const QDomNode &aXML ) void Configuration::saveRooms( const QDomNode &aXML ) { - qDebug() << "saveRooms"; //! List of rooms must be cleared and rewritten again QDomDocument doc = aXML.ownerDocument(); QDomNode root = aXML; @@ -218,12 +217,13 @@ void Configuration::saveRooms( const QDomNode &aXML ) node = root.removeChild(node); node = next; } + + node = aXML; QList::iterator i; for ( i = iRooms.begin(); i != iRooms.end(); ++i ) { QDomElement tag = doc.createElement( "room" ); - qDebug() << "write room: " << ( *i )->name() << " to node " << node.toElement().tagName(); - root.appendChild( tag ); + node.appendChild( tag ); // First room in the list is a dafault room if ( i == iRooms.begin() ) @@ -463,7 +463,6 @@ QList Configuration::readRooms( const QDomNode &aXML ) if ( tagName == QString( "name" ) ) { name = roomElem.text(); - qDebug() << "got room: " << name; } else if ( tagName == QString( "address" ) ) {