18 const QDomNodeList &nodes =
m_document->elementsByTagName(helper.nodeName(
"trackList"));
19 for(
int i = 0; i < nodes.count(); ++i)
21 const QDomNodeList &trackNodes = nodes.item(i).childNodes();
22 for(
int i = 0; i < trackNodes.count(); ++i)
24 const QDomNodeList &trackChildNodes = trackNodes.item(i).childNodes();
26 QString duration, path;
27 for(
int i = 0; i < trackChildNodes.count(); ++i)
29 const QDomElement &element = trackChildNodes.item(i).toElement();
30 const QString &
name = element.nodeName().toLower();
32 if(name ==
"location")
34 path = element.text();
35 path.remove(
"file://");
37 else if(name ==
"length" || name ==
"duration")
39 duration = element.text();
65 QDomElement rootDom =
createRoot(
"playlist", {{
"version",
"1"}, {
"xmlns",
"http://xspf.org/ns/0/"}});
68 for(
int i = 0; i < items.count(); ++i)
The class of the ttk xml interface.
QDomDocument * m_document
QDomElement writeDomElement(QDomElement &element, const QString &node) const
void createProcessingInstruction() const
QDomElement createRoot(const QString &node) const
The class of the ttk xml hepler.
virtual bool readBuffer(MusicSongItemList &items) overridefinal
The class of the read write interface.
The class of the music song item.
virtual bool writeBuffer(const MusicSongItemList &items) overridefinal
The class of the music song info.