Replace QRegExp with QRegularExpression
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include <QByteArray>
|
||||
#include <QString>
|
||||
#include <QStringBuilder>
|
||||
#include <QRegularExpression>
|
||||
#include <QRegExp>
|
||||
#include <QUrl>
|
||||
#include <QXmlStreamReader>
|
||||
@@ -52,7 +53,7 @@ SongList ASXParser::Load(QIODevice *device, const QString &playlist_path, const
|
||||
int index = 0;
|
||||
while ((index = ex.indexIn(data, index)) != -1) {
|
||||
QString url = ex.cap(2);
|
||||
url.replace(QRegExp("&(?!amp;|quot;|apos;|lt;|gt;)"), "&");
|
||||
url.replace(QRegularExpression("&(?!amp;|quot;|apos;|lt;|gt;)"), "&");
|
||||
|
||||
QByteArray replacement = QString(ex.cap(1) + url + "\"").toLocal8Bit();
|
||||
data.replace(ex.cap(0).toLocal8Bit(), replacement);
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QRegularExpression>
|
||||
#include <QRegExp>
|
||||
#include <QTextCodec>
|
||||
#include <QTextStream>
|
||||
@@ -62,7 +63,9 @@ SongList CueParser::Load(QIODevice *device, const QString &playlist_path, const
|
||||
SongList ret;
|
||||
|
||||
QTextStream text_stream(device);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
text_stream.setCodec(QTextCodec::codecForUtfText(device->peek(1024), QTextCodec::codecForName("UTF-8")));
|
||||
#endif
|
||||
|
||||
QString dir_path = dir.absolutePath();
|
||||
// read the first line already
|
||||
@@ -234,7 +237,7 @@ SongList CueParser::Load(QIODevice *device, const QString &playlist_path, const
|
||||
|
||||
// Cue song has mtime equal to qMax(media_file_mtime, cue_sheet_mtime)
|
||||
if (cue_mtime.isValid()) {
|
||||
song.set_mtime(qMax(cue_mtime.toTime_t(), song.mtime()));
|
||||
song.set_mtime(qMax(static_cast<quint64>(cue_mtime.toSecsSinceEpoch()), song.mtime()));
|
||||
}
|
||||
song.set_cue_path(playlist_path);
|
||||
|
||||
@@ -275,7 +278,7 @@ QStringList CueParser::SplitCueLine(const QString &line) const {
|
||||
}
|
||||
|
||||
// Let's remove the empty entries while we're at it
|
||||
return line_regexp.capturedTexts().filter(QRegExp(".+")).mid(1, -1);
|
||||
return line_regexp.capturedTexts().filter(QRegularExpression(".+")).mid(1, -1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QString>
|
||||
#include <QRegExp>
|
||||
#include <QRegularExpression>
|
||||
#include <QUrl>
|
||||
|
||||
#include "core/logging.h"
|
||||
@@ -43,7 +43,7 @@ void ParserBase::LoadSong(const QString &filename_or_url, qint64 beginning, cons
|
||||
|
||||
QString filename = filename_or_url;
|
||||
|
||||
if (filename_or_url.contains(QRegExp("^[a-z]{2,}:"))) {
|
||||
if (filename_or_url.contains(QRegularExpression("^[a-z]{2,}:"))) {
|
||||
QUrl url(filename_or_url);
|
||||
song->set_source(Song::SourceFromURL(url));
|
||||
if (song->source() == Song::Source_LocalFile) {
|
||||
|
||||
Reference in New Issue
Block a user