diff options
author | Iain <qt-info@nokia.com> | 2009-08-20 18:45:18 (GMT) |
---|---|---|
committer | Iain <qt-info@nokia.com> | 2009-08-20 18:45:18 (GMT) |
commit | 5f312095bf30aa54ba45a98c2db777fb57b6aee8 (patch) | |
tree | 2bd82e28b8b5a8fc0a8aaffd6cc63f3bf3ac98a0 /examples/xml/streambookmarks/xbelwriter.cpp | |
parent | 6c2cabdc96c48637b18a1cb294d38e4ddb2f280d (diff) | |
parent | 4ba5a86f530e93c179c9049d36b2f38595a5ef09 (diff) | |
download | Qt-5f312095bf30aa54ba45a98c2db777fb57b6aee8.zip Qt-5f312095bf30aa54ba45a98c2db777fb57b6aee8.tar.gz Qt-5f312095bf30aa54ba45a98c2db777fb57b6aee8.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt-s60-public
Diffstat (limited to 'examples/xml/streambookmarks/xbelwriter.cpp')
-rw-r--r-- | examples/xml/streambookmarks/xbelwriter.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/examples/xml/streambookmarks/xbelwriter.cpp b/examples/xml/streambookmarks/xbelwriter.cpp index 3a2862a..58757f5 100644 --- a/examples/xml/streambookmarks/xbelwriter.cpp +++ b/examples/xml/streambookmarks/xbelwriter.cpp @@ -47,23 +47,23 @@ XbelWriter::XbelWriter(QTreeWidget *treeWidget) : treeWidget(treeWidget) { - setAutoFormatting(true); + xml.setAutoFormatting(true); } //! [0] //! [1] bool XbelWriter::writeFile(QIODevice *device) { - setDevice(device); + xml.setDevice(device); - writeStartDocument(); - writeDTD("<!DOCTYPE xbel>"); - writeStartElement("xbel"); - writeAttribute("version", "1.0"); + xml.writeStartDocument(); + xml.writeDTD("<!DOCTYPE xbel>"); + xml.writeStartElement("xbel"); + xml.writeAttribute("version", "1.0"); for (int i = 0; i < treeWidget->topLevelItemCount(); ++i) writeItem(treeWidget->topLevelItem(i)); - writeEndDocument(); + xml.writeEndDocument(); return true; } //! [1] @@ -74,20 +74,20 @@ void XbelWriter::writeItem(QTreeWidgetItem *item) QString tagName = item->data(0, Qt::UserRole).toString(); if (tagName == "folder") { bool folded = !treeWidget->isItemExpanded(item); - writeStartElement(tagName); - writeAttribute("folded", folded ? "yes" : "no"); - writeTextElement("title", item->text(0)); + xml.writeStartElement(tagName); + xml.writeAttribute("folded", folded ? "yes" : "no"); + xml.writeTextElement("title", item->text(0)); for (int i = 0; i < item->childCount(); ++i) writeItem(item->child(i)); - writeEndElement(); + xml.writeEndElement(); } else if (tagName == "bookmark") { - writeStartElement(tagName); + xml.writeStartElement(tagName); if (!item->text(1).isEmpty()) - writeAttribute("href", item->text(1)); - writeTextElement("title", item->text(0)); - writeEndElement(); + xml.writeAttribute("href", item->text(1)); + xml.writeTextElement("title", item->text(0)); + xml.writeEndElement(); } else if (tagName == "separator") { - writeEmptyElement(tagName); + xml.writeEmptyElement(tagName); } } //! [2] |