Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WPL Parser: Implement no-metadata playlist saving.
Browse files Browse the repository at this point in the history
smithjd15 committed Mar 17, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 4de215c commit 7bc54f7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/playlistparsers/wplparser.cpp
Original file line number Diff line number Diff line change
@@ -79,14 +79,19 @@ void WplParser::ParseSeq(const QDir& dir, QXmlStreamReader* reader,

void WplParser::Save(const SongList& songs, QIODevice* device, const QDir& dir,
Playlist::Path path_type) const {
QSettings s;
s.beginGroup(Playlist::kSettingsGroup);
bool writeMetadata = s.value(Playlist::kWriteMetadata, true).toBool();
s.endGroup();

QXmlStreamWriter writer(device);
writer.setAutoFormatting(true);
writer.setAutoFormattingIndent(2);
writer.writeProcessingInstruction("wpl", "version=\"1.0\"");

StreamElement smil("smil", &writer);

{
if (writeMetadata) {
StreamElement head("head", &writer);
WriteMeta("Generator", "Clementine -- " CLEMENTINE_VERSION_DISPLAY,
&writer);

0 comments on commit 7bc54f7

Please sign in to comment.