Formatting
This commit is contained in:
@@ -51,7 +51,7 @@ SongList ASXParser::Load(QIODevice *device, const QString &playlist_path, const
|
||||
// Some playlists have unescaped & characters in URLs :(
|
||||
QRegularExpression ex("(href\\s*=\\s*\")([^\"]+)\"", QRegularExpression::CaseInsensitiveOption);
|
||||
int index = 0;
|
||||
for (QRegularExpressionMatch re_match = ex.match(data, index) ; re_match.hasMatch() ; re_match = ex.match(data, index)) {
|
||||
for (QRegularExpressionMatch re_match = ex.match(data, index); re_match.hasMatch(); re_match = ex.match(data, index)) {
|
||||
index = re_match.capturedStart();
|
||||
QString url = re_match.captured(2);
|
||||
url.replace(QRegularExpression("&(?!amp;|quot;|apos;|lt;|gt;)"), "&");
|
||||
|
||||
@@ -110,8 +110,9 @@ QString ParserBase::URLOrFilename(const QUrl &url, const QDir &dir, Playlist::Pa
|
||||
if (path_type != Playlist::Path_Absolute && QDir::isAbsolutePath(filename)) {
|
||||
const QString relative = dir.relativeFilePath(filename);
|
||||
|
||||
if (!relative.startsWith("../") || path_type == Playlist::Path_Relative)
|
||||
if (!relative.startsWith("../") || path_type == Playlist::Path_Relative) {
|
||||
return relative;
|
||||
}
|
||||
}
|
||||
return filename;
|
||||
|
||||
|
||||
@@ -65,8 +65,9 @@ SongList PLSParser::Load(QIODevice *device, const QString &playlist_path, const
|
||||
|
||||
// Use the title and length we've already loaded if any
|
||||
if (!songs[n].title().isEmpty()) song.set_title(songs[n].title());
|
||||
if (songs[n].length_nanosec() != -1)
|
||||
if (songs[n].length_nanosec() != -1) {
|
||||
song.set_length_nanosec(songs[n].length_nanosec());
|
||||
}
|
||||
|
||||
songs[n] = song;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user