Merge pull request #1717 from Integral-Tech/optimize-qstring

refactor: replace QString constructors with QStringLiteral
This commit is contained in:
DeepBlueV7.X 2024-04-28 16:44:42 +00:00 committed by GitHub
commit f465a5b52f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 9 deletions

View file

@ -19,7 +19,7 @@ FallbackAuth::FallbackAuth(const QString &session, const QString &authType, QObj
void
FallbackAuth::openFallbackAuth()
{
const auto url = QString("https://%1:%2/_matrix/client/r0/auth/%4/"
const auto url = QStringLiteral("https://%1:%2/_matrix/client/r0/auth/%4/"
"fallback/web?session=%3")
.arg(QString::fromStdString(http::client()->server()))
.arg(http::client()->port())

View file

@ -19,7 +19,7 @@ ReCaptcha::ReCaptcha(const QString &session, const QString &context, QObject *pa
void
ReCaptcha::openReCaptcha()
{
const auto url = QString("https://%1:%2/_matrix/client/r0/auth/m.login.recaptcha/"
const auto url = QStringLiteral("https://%1:%2/_matrix/client/r0/auth/m.login.recaptcha/"
"fallback/web?session=%3")
.arg(QString::fromStdString(http::client()->server()))
.arg(http::client()->port())

View file

@ -1110,7 +1110,7 @@ utils::getFormattedQuoteBody(const RelatedInfo &related, const QString &html)
}
}
};
return QString("<mx-reply><blockquote><a "
return QStringLiteral("<mx-reply><blockquote><a "
"href=\"https://matrix.to/#/%1/%2\">In reply "
"to</a> <a href=\"https://matrix.to/#/%3\">%4</a><br"
"/>%5</blockquote></mx-reply>")

View file

@ -75,7 +75,7 @@ MediaUpload::thumbnailDataUrl() const
buffer.open(QIODevice::WriteOnly);
thumbnail_.save(&buffer, "PNG");
QString base64 = QString::fromUtf8(byteArray.toBase64());
return QString("data:image/png;base64,") + base64;
return QStringLiteral("data:image/png;base64,") + base64;
}
bool