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" ) )
{
node = next;
}
+ node = aXML;
QList<Room*>::iterator i;
for ( i = iRooms.begin(); i != iRooms.end(); ++i )
{
bool success = false;
unsigned int weekDayTmp = e.text().toUInt( &success );
- if( success && weekDayTmp >= 0 && weekDayTmp < 7)
+ if( success && weekDayTmp < 7 )
{
dayOfWeek = (DateTimeSettings::weekDay)weekDayTmp;
}