| 798 | } |
| 799 | |
| 800 | QString PlaylistTreeWidget::getPlaylistString(QDir dirName) |
| 801 | { |
| 802 | // Create the XML document structure |
| 803 | QDomDocument document; |
| 804 | document.appendChild(document.createProcessingInstruction( |
| 805 | QStringLiteral("xml"), QStringLiteral("version=\"1.0\" encoding=\"UTF-8\""))); |
| 806 | QDomElement plist = document.createElement(QStringLiteral("playlistItems")); |
| 807 | plist.setAttribute(QStringLiteral("version"), QStringLiteral("2.0")); |
| 808 | document.appendChild(plist); |
| 809 | |
| 810 | // Append all the playlist items to the output |
| 811 | for (int i = 0; i < topLevelItemCount(); ++i) |
| 812 | { |
| 813 | QTreeWidgetItem *item = topLevelItem(i); |
| 814 | playlistItem * plItem = dynamic_cast<playlistItem *>(item); |
| 815 | |
| 816 | plItem->savePlaylist(plist, dirName); |
| 817 | } |
| 818 | |
| 819 | // Append the view states |
| 820 | QDomElement states = document.createElement(QStringLiteral("viewStates")); |
| 821 | plist.appendChild(states); |
| 822 | stateHandler->savePlaylist(states); |
| 823 | |
| 824 | return document.toString(); |
| 825 | } |
| 826 | |
| 827 | void PlaylistTreeWidget::savePlaylistToFile() |
| 828 | { |
nothing calls this directly
no test coverage detected