summary refs log tree commit diff
path: root/src/MxcImageProvider.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-12-28 20:09:08 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-12-28 20:09:08 +0100
commit5ca98829f7c5bf504e78bd51e6ceb534c023ae05 (patch)
tree2e624400f17b2b8220431a500e4ffc9f3671e4a7 /src/MxcImageProvider.cpp
parentMisc clang-tidy fixes (diff)
downloadnheko-5ca98829f7c5bf504e78bd51e6ceb534c023ae05.tar.xz
Some qt6 prep
Diffstat (limited to 'src/MxcImageProvider.cpp')
-rw-r--r--src/MxcImageProvider.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/MxcImageProvider.cpp b/src/MxcImageProvider.cpp
index 74b4bedc..96e1e094 100644
--- a/src/MxcImageProvider.cpp
+++ b/src/MxcImageProvider.cpp
@@ -32,15 +32,15 @@ MxcImageProvider::requestImageResponse(const QString &id, const QSize &requested
     auto queryStart = id.lastIndexOf('?');
     if (queryStart != -1) {
         id_            = id.left(queryStart);
-        auto query     = id.midRef(queryStart + 1);
+        auto query     = QStringView(id).mid(queryStart + 1);
         auto queryBits = query.split('&');
 
         for (auto b : queryBits) {
-            if (b == "scale") {
+            if (b == QStringView(u"scale")) {
                 crop = false;
-            } else if (b.startsWith("radius=")) {
+            } else if (b.startsWith(QStringView(u"radius="))) {
                 radius = b.mid(7).toDouble();
-            } else if (b.startsWith("height=")) {
+            } else if (b.startsWith(u"height=")) {
                 size.setHeight(b.mid(7).toInt());
                 size.setWidth(0);
             }
@@ -109,7 +109,7 @@ MxcImageProvider::download(const QString &id,
         // Protect against synapse not following the spec:
         // https://github.com/matrix-org/synapse/issues/5302
         && requestedSize.height() <= 600 && requestedSize.width() <= 800) {
-        QString fileName = QString("%1_%2x%3_%4_radius%5")
+        QString fileName = QStringLiteral("%1_%2x%3_%4_radius%5")
                              .arg(QString::fromUtf8(id.toUtf8().toBase64(
                                QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals)))
                              .arg(requestedSize.width())