Use QStringLiteral
This commit is contained in:
@@ -94,17 +94,17 @@ QStringList Updateify(const QStringList &list) {
|
||||
QString DecodeHtmlEntities(const QString &text) {
|
||||
|
||||
QString copy(text);
|
||||
copy.replace("&", "&")
|
||||
.replace("&", "&")
|
||||
.replace(""", "\"")
|
||||
.replace(""", "\"")
|
||||
.replace("'", "'")
|
||||
.replace("'", "'")
|
||||
.replace("<", "<")
|
||||
.replace("<", "<")
|
||||
.replace(">", ">")
|
||||
.replace(">", ">")
|
||||
.replace("'", "'");
|
||||
copy.replace(QLatin1String("&"), QLatin1String("&"))
|
||||
.replace(QLatin1String("&"), QLatin1String("&"))
|
||||
.replace(QLatin1String("""), QLatin1String("\""))
|
||||
.replace(QLatin1String("""), QLatin1String("\""))
|
||||
.replace(QLatin1String("'"), QLatin1String("'"))
|
||||
.replace(QLatin1String("'"), QLatin1String("'"))
|
||||
.replace(QLatin1String("<"), QLatin1String("<"))
|
||||
.replace(QLatin1String("<"), QLatin1String("<"))
|
||||
.replace(QLatin1String(">"), QLatin1String(">"))
|
||||
.replace(QLatin1String(">"), QLatin1String(">"))
|
||||
.replace(QLatin1String("'"), QLatin1String("'"));
|
||||
|
||||
return copy;
|
||||
|
||||
@@ -112,7 +112,7 @@ QString DecodeHtmlEntities(const QString &text) {
|
||||
|
||||
QString ReplaceMessage(const QString &message, const Song &song, const QString &newline, const bool html_escaped) {
|
||||
|
||||
QRegularExpression variable_replacer("[%][a-z]+[%]");
|
||||
QRegularExpression variable_replacer(QStringLiteral("[%][a-z]+[%]"));
|
||||
QString copy(message);
|
||||
|
||||
// Replace the first line
|
||||
@@ -125,7 +125,7 @@ QString ReplaceMessage(const QString &message, const Song &song, const QString &
|
||||
pos += match.capturedLength();
|
||||
}
|
||||
|
||||
qint64 index_of = copy.indexOf(QRegularExpression(" - (>|$)"));
|
||||
qint64 index_of = copy.indexOf(QRegularExpression(QStringLiteral(" - (>|$)")));
|
||||
if (index_of >= 0) copy = copy.remove(index_of, 3);
|
||||
|
||||
return copy;
|
||||
|
||||
Reference in New Issue
Block a user