Use QStringLiteral

This commit is contained in:
Jonas Kvinge
2024-04-09 23:20:26 +02:00
parent 3cfffa5fbb
commit 58944993b8
233 changed files with 3885 additions and 3885 deletions

View File

@@ -50,7 +50,7 @@ SongList PLSParser::Load(QIODevice *device, const QString &playlist_path, const
Q_UNUSED(playlist_path);
QMap<int, Song> songs;
QRegularExpression n_re("\\d+$");
QRegularExpression n_re(QStringLiteral("\\d+$"));
while (!device->atEnd()) {
QString line = QString::fromUtf8(device->readLine()).trimmed();
@@ -61,7 +61,7 @@ SongList PLSParser::Load(QIODevice *device, const QString &playlist_path, const
QRegularExpressionMatch re_match = n_re.match(key);
int n = re_match.captured(0).toInt();
if (key.startsWith("file")) {
if (key.startsWith(QLatin1String("file"))) {
Song song = LoadSong(value, 0, 0, dir, collection_search);
// Use the title and length we've already loaded if any
@@ -72,10 +72,10 @@ SongList PLSParser::Load(QIODevice *device, const QString &playlist_path, const
songs[n] = song;
}
else if (key.startsWith("title")) {
else if (key.startsWith(QLatin1String("title"))) {
songs[n].set_title(value);
}
else if (key.startsWith("length")) {
else if (key.startsWith(QLatin1String("length"))) {
qint64 seconds = value.toLongLong();
if (seconds > 0) {
songs[n].set_length_nanosec(seconds * kNsecPerSec);