diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-07 22:30:29 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-07 22:30:29 +0000 |
commit | d8b40941f9d1a221add0b9094eb09405a91a8aab (patch) | |
tree | 0b8e9b6347f6e75925bb3c386a47c5300b1a4775 /kitchensync/src/configguifile.cpp | |
parent | 009631d0fc83f471d6c515e2a5001337a5a2ea21 (diff) | |
download | tdepim-d8b40941f9d1a221add0b9094eb09405a91a8aab.tar.gz tdepim-d8b40941f9d1a221add0b9094eb09405a91a8aab.zip |
Part 2/2 of Chakra patch commit
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1172727 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kitchensync/src/configguifile.cpp')
-rw-r--r-- | kitchensync/src/configguifile.cpp | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/kitchensync/src/configguifile.cpp b/kitchensync/src/configguifile.cpp index 6a8b0402c..a0c6a596d 100644 --- a/kitchensync/src/configguifile.cpp +++ b/kitchensync/src/configguifile.cpp @@ -55,13 +55,20 @@ void ConfigGuiFile::load( const TQString &xml ) TQDomDocument doc; doc.setContent( xml ); TQDomElement docElement = doc.documentElement(); - TQDomNode n; - for( n = docElement.firstChild(); !n.isNull(); n = n.nextSibling() ) { - TQDomElement e = n.toElement(); - if ( e.tagName() == "path" ) { - mFilename->setURL( e.text() ); - } else if ( e.tagName() == "recursive" ) { - mRecursive->setChecked( e.text() == "TRUE" ); + + TQDomNode node; + for ( node = docElement.firstChild(); !node.isNull(); node = node.nextSibling() ) { + TQDomElement e = node.toElement(); + if ( e.tagName() == "directory" ) { + TQDomNode subNode; + for ( subNode = e.firstChild(); !subNode.isNull(); subNode = subNode.nextSibling() ) { + TQDomElement subElement = subNode.toElement(); + if ( subElement.tagName() == "path" ) { + mFilename->setURL( subElement.text() ); + } else if ( subElement.tagName() == "recursive" ) { + mRecursive->setChecked( subElement.text() == "TRUE" ); + } + } } } } @@ -69,13 +76,18 @@ void ConfigGuiFile::load( const TQString &xml ) TQString ConfigGuiFile::save() const { TQString xml; - xml = "<config>"; - xml += "<path>" + mFilename->url() + "</path>"; - xml += "<recursive>"; - if ( mRecursive->isChecked() ) xml += "TRUE"; - else xml += "FALSE"; - xml += "</recursive>"; - xml += "</config>"; + xml = "<config>\n"; + xml += " <directory>\n"; + xml += " <path>" + mFilename->url() + "</path>\n"; + xml += " <objtype>data</objtype>\n"; + xml += " <recursive>"; + if ( mRecursive->isChecked() ) + xml += "TRUE"; + else + xml += "FALSE"; + xml += "</recursive>\n"; + xml += " </directory>\n"; + xml += "</config>\n"; return xml; } |