Use static QRegularExpression
This commit is contained in:
@@ -332,7 +332,8 @@ QString RadioModel::SortText(QString text) {
|
||||
else {
|
||||
text = text.toLower();
|
||||
}
|
||||
text = text.remove(QRegularExpression(QStringLiteral("[^\\w ]"), QRegularExpression::UseUnicodePropertiesOption));
|
||||
static const QRegularExpression regex_words_and_whitespaces(QStringLiteral("[^\\w ]"), QRegularExpression::UseUnicodePropertiesOption);
|
||||
text = text.remove(regex_words_and_whitespaces);
|
||||
|
||||
return text;
|
||||
|
||||
|
||||
@@ -109,7 +109,8 @@ void RadioParadiseService::GetChannelsReply(QNetworkReply *reply, const int task
|
||||
}
|
||||
QString label = obj_stream[QLatin1String("label")].toString();
|
||||
QString url = obj_stream[QLatin1String("url")].toString();
|
||||
if (!url.contains(QRegularExpression(QStringLiteral("^[0-9a-zA-Z]*:\\/\\/"), QRegularExpression::CaseInsensitiveOption))) {
|
||||
static const QRegularExpression regex_url_schema(QStringLiteral("^[0-9a-zA-Z]*:\\/\\/"), QRegularExpression::CaseInsensitiveOption);
|
||||
if (!url.contains(regex_url_schema)) {
|
||||
url.prepend(QLatin1String("https://"));
|
||||
}
|
||||
RadioChannel channel;
|
||||
|
||||
Reference in New Issue
Block a user