Remove unnecessary checks.

This commit is contained in:
John Maguire 2010-05-23 17:04:55 +00:00
parent 07b2c38690
commit a0f19e5923
2 changed files with 2 additions and 11 deletions

View File

@ -102,11 +102,7 @@ void M3UParser::Save(const SongList &songs, QIODevice *device, const QDir &dir)
}
QString meta = QString("#EXTINF:%1,%2 - %3\n").arg(song.length()).arg(song.artist()).arg(song.title());
device->write(meta.toLatin1());
if (song.filetype() == Song::Type_Stream) {
device->write(song.filename().toLatin1());
} else {
device->write(MakeRelativeTo(song.filename(), dir).toLatin1());
}
device->write(MakeRelativeTo(song.filename(), dir).toLatin1());
device->write("\n");
}
}

View File

@ -145,12 +145,7 @@ void XSPFParser::Save(const SongList &songs, QIODevice *device, const QDir &dir)
QDomElement track_list = doc.createElement("trackList");
root.appendChild(track_list);
foreach (const Song& song, songs) {
QString url;
if (song.filetype() == Song::Type_Stream) {
url = song.filename();
} else {
url = QUrl::fromLocalFile(MakeRelativeTo(song.filename(), dir)).toString();
}
QString url = MakeRelativeTo(song.filename(), dir);
if (url.isEmpty()) {
continue; // Skip empty items like Last.fm streams.
}