Mercurial > hg > svcore
comparison 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 |
comparison
equal
deleted
inserted
replaced
313:29485aa03da4 | 314:70a232b1f12a |
---|---|
12 License, or (at your option) any later version. See the file | 12 License, or (at your option) any later version. See the file |
13 COPYING included with this distribution for more information. | 13 COPYING included with this distribution for more information. |
14 */ | 14 */ |
15 | 15 |
16 #include "Selection.h" | 16 #include "Selection.h" |
17 #include <QTextStream> | |
17 | 18 |
18 Selection::Selection() : | 19 Selection::Selection() : |
19 m_startFrame(0), | 20 m_startFrame(0), |
20 m_endFrame(0) | 21 m_endFrame(0) |
21 { | 22 { |
210 } | 211 } |
211 | 212 |
212 return Selection(); | 213 return Selection(); |
213 } | 214 } |
214 | 215 |
215 QString | 216 void |
216 MultiSelection::toXmlString(QString indent, | 217 MultiSelection::toXml(QTextStream &stream, QString indent, |
217 QString extraAttributes) const | 218 QString extraAttributes) const |
218 { | 219 { |
219 QString s; | 220 stream << indent << QString("<selections %1>\n").arg(extraAttributes); |
220 s += indent + QString("<selections %1>\n").arg(extraAttributes); | |
221 for (SelectionList::iterator i = m_selections.begin(); | 221 for (SelectionList::iterator i = m_selections.begin(); |
222 i != m_selections.end(); ++i) { | 222 i != m_selections.end(); ++i) { |
223 s += indent + QString(" <selection start=\"%1\" end=\"%2\"/>\n") | 223 stream << indent |
224 << QString(" <selection start=\"%1\" end=\"%2\"/>\n") | |
224 .arg(i->getStartFrame()).arg(i->getEndFrame()); | 225 .arg(i->getStartFrame()).arg(i->getEndFrame()); |
225 } | 226 } |
226 s += indent + "</selections>\n"; | 227 stream << indent << "</selections>\n"; |
227 return s; | 228 } |
228 } | 229 |
229 |