Mercurial > hg > svcore
diff base/Selection.cpp @ 314:70a232b1f12a
* Make XmlExportable::toXml the function that is universally overridden (and
pure virtual) instead of toXmlString. Tidies up some classes, notably the
model classes, significantly. Closes #1794561.
author | Chris Cannam |
---|---|
date | Thu, 18 Oct 2007 10:15:07 +0000 |
parents | 5877d68815c7 |
children | 6a94bb528e9d |
line wrap: on
line diff
--- a/base/Selection.cpp Wed Oct 17 12:58:45 2007 +0000 +++ b/base/Selection.cpp Thu Oct 18 10:15:07 2007 +0000 @@ -14,6 +14,7 @@ */ #include "Selection.h" +#include <QTextStream> Selection::Selection() : m_startFrame(0), @@ -212,18 +213,17 @@ return Selection(); } -QString -MultiSelection::toXmlString(QString indent, - QString extraAttributes) const +void +MultiSelection::toXml(QTextStream &stream, QString indent, + QString extraAttributes) const { - QString s; - s += indent + QString("<selections %1>\n").arg(extraAttributes); + stream << indent << QString("<selections %1>\n").arg(extraAttributes); for (SelectionList::iterator i = m_selections.begin(); i != m_selections.end(); ++i) { - s += indent + QString(" <selection start=\"%1\" end=\"%2\"/>\n") + stream << indent + << QString(" <selection start=\"%1\" end=\"%2\"/>\n") .arg(i->getStartFrame()).arg(i->getEndFrame()); } - s += indent + "</selections>\n"; - return s; + stream << indent << "</selections>\n"; }