Mercurial > hg > svcore
diff base/PlayParameters.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 | 41d64b873d87 |
children | 5858cc462d0a |
line wrap: on
line diff
--- a/base/PlayParameters.cpp Wed Oct 17 12:58:45 2007 +0000 +++ b/base/PlayParameters.cpp Thu Oct 18 10:15:07 2007 +0000 @@ -17,6 +17,8 @@ #include <iostream> +#include <QTextStream> + void PlayParameters::copyFrom(const PlayParameters *pp) { @@ -27,25 +29,24 @@ m_playPluginConfiguration = pp->getPlayPluginConfiguration(); } -QString -PlayParameters::toXmlString(QString indent, - QString extraAttributes) const +void +PlayParameters::toXml(QTextStream &stream, + QString indent, + QString extraAttributes) const { - QString s; - s += indent; - s += QString("<playparameters mute=\"%1\" pan=\"%2\" gain=\"%3\" pluginId=\"%4\" %6") + stream << indent; + stream << QString("<playparameters mute=\"%1\" pan=\"%2\" gain=\"%3\" pluginId=\"%4\" %6") .arg(m_playMuted ? "true" : "false") .arg(m_playPan) .arg(m_playGain) .arg(m_playPluginId) .arg(extraAttributes); if (m_playPluginConfiguration != "") { - s += ">\n " + indent + m_playPluginConfiguration - + "\n" + indent + "</playparameters>\n"; + stream << ">\n " << indent << m_playPluginConfiguration + << "\n" << indent << "</playparameters>\n"; } else { - s += "/>\n"; + stream << "/>\n"; } - return s; } void