[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdepim/kresources/opengroupware
From: Reinhold Kainhofer <reinhold () kainhofer ! com>
Date: 2004-12-12 21:06:17
Message-ID: 20041212210617.CB4C71763F () office ! kde ! org
[Download RAW message or body]
CVS commit by kainhofe:
Clean up the webdav dom tree generating mthods of the webdav handler a bit.
M +14 -13 webdavhandler.cpp 1.12
M +5 -9 webdavhandler.h 1.7
--- kdepim/kresources/opengroupware/webdavhandler.h #1.6:1.7
@@ -34,15 +34,11 @@ class WebdavHandler
- static QDomElement addElement( QDomDocument &doc, QDomNode &node,
- const QString &ns, const QString &tag );
+ static QDomElement addElementNS( QDomDocument &doc, QDomNode &node,
+ const QString &ns, const QString &tag,
+ const QString &value = QString::null );
static QDomElement addElement( QDomDocument &, QDomNode &,
- const QString &tag );
+ const QString &tag, const QString &value = QString::null );
static QDomElement addDavElement( QDomDocument &, QDomNode &,
- const QString &tag );
- static QDomElement addSloxElement( QDomDocument &, QDomNode &,
- const QString &tag,
- const QString &text = QString::null );
- static QDomText addTextNode( QDomDocument &doc,
- QDomNode &node, const QString &text );
+ const QString &tag, const QString &value = QString::null );
/**
--- kdepim/kresources/opengroupware/webdavhandler.cpp #1.11:1.12
@@ -42,31 +42,31 @@ KURL WebdavHandler::toDAV( const KURL& u
QDomElement WebdavHandler::addElement( QDomDocument &doc, QDomNode &node,
- const QString &tag )
+ const QString &tag, const QString &value )
{
QDomElement el = doc.createElement( tag );
node.appendChild( el );
+ if ( !value.isNull() ) {
+ QDomText txt = doc.createTextNode( value );
+ el.appendChild( txt );
+ }
return el;
}
-QDomElement WebdavHandler::addElement( QDomDocument &doc, QDomNode &node,
- const QString &ns, const QString &tag )
+QDomElement WebdavHandler::addElementNS( QDomDocument &doc, QDomNode &node,
+ const QString &ns, const QString &tag, const QString &value )
{
QDomElement el = doc.createElementNS( ns, tag );
node.appendChild( el );
+ if ( !value.isNull() ) {
+ QDomText txt = doc.createTextNode( value );
+ el.appendChild( txt );
+ }
return el;
}
QDomElement WebdavHandler::addDavElement( QDomDocument &doc, QDomNode &node,
- const QString &tag )
-{
- QDomElement el = doc.createElementNS( "DAV:", tag );
- node.appendChild( el );
- return el;
-}
-QDomText WebdavHandler::addTextNode( QDomDocument &doc, QDomNode &node, const QString &text )
+ const QString &tag, const QString &value )
{
- QDomText el = doc.createTextNode( text );
- node.appendChild( el );
- return el;
+ return addElementNS( doc, node, "DAV:", tag, value );
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic