diff options
author | DeepBlueV7.X <nicolas.werner@hotmail.de> | 2024-04-28 16:44:42 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-28 16:44:42 +0000 |
commit | f465a5b52fccfb0f6bc88f7279dfc842bc421ee2 (patch) | |
tree | b1469e9dfc0775badcd00f1382f7bb5753144218 | |
parent | Merge pull request #1708 from NepNep21/windows-image-copying (diff) | |
parent | refactor: replace QString constructors with QStringLiteral (diff) | |
download | nheko-f465a5b52fccfb0f6bc88f7279dfc842bc421ee2.tar.xz |
Merge pull request #1717 from Integral-Tech/optimize-qstring
refactor: replace QString constructors with QStringLiteral
-rw-r--r-- | src/FallbackAuth.cpp | 4 | ||||
-rw-r--r-- | src/ReCaptcha.cpp | 4 | ||||
-rw-r--r-- | src/Utils.cpp | 8 | ||||
-rw-r--r-- | src/timeline/InputBar.cpp | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/src/FallbackAuth.cpp b/src/FallbackAuth.cpp index dc16b7cb..d5f8c861 100644 --- a/src/FallbackAuth.cpp +++ b/src/FallbackAuth.cpp @@ -19,8 +19,8 @@ FallbackAuth::FallbackAuth(const QString &session, const QString &authType, QObj void FallbackAuth::openFallbackAuth() { - const auto url = QString("https://%1:%2/_matrix/client/r0/auth/%4/" - "fallback/web?session=%3") + 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()) .arg(m_session, m_authType); diff --git a/src/ReCaptcha.cpp b/src/ReCaptcha.cpp index a1d0c56f..9a89bb4d 100644 --- a/src/ReCaptcha.cpp +++ b/src/ReCaptcha.cpp @@ -19,8 +19,8 @@ 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/" - "fallback/web?session=%3") + 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()) .arg(m_session); diff --git a/src/Utils.cpp b/src/Utils.cpp index 498bad9a..b4d45472 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -1110,10 +1110,10 @@ utils::getFormattedQuoteBody(const RelatedInfo &related, const QString &html) } } }; - return QString("<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>") + 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>") .arg(related.room, QString::fromStdString(related.related_event), related.quoted_user, diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp index e0dfe9b9..1a086c2b 100644 --- a/src/timeline/InputBar.cpp +++ b/src/timeline/InputBar.cpp @@ -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 |