summary refs log tree commit diff
path: root/src/ui/MxcMediaProxy.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-12-29 04:28:08 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-12-29 04:52:52 +0100
commitd8ead9573b6fd45e386d54b9aaec4e1c335b10ec (patch)
tree514d00ee26e67fc8bfeff403858e7d4ef276e6e3 /src/ui/MxcMediaProxy.cpp
parentuse more literals (diff)
downloadnheko-d8ead9573b6fd45e386d54b9aaec4e1c335b10ec.tar.xz
Reduce allocations using QStringLiteral
Diffstat (limited to 'src/ui/MxcMediaProxy.cpp')
-rw-r--r--src/ui/MxcMediaProxy.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ui/MxcMediaProxy.cpp b/src/ui/MxcMediaProxy.cpp

index 4fe9eef8..27f34021 100644 --- a/src/ui/MxcMediaProxy.cpp +++ b/src/ui/MxcMediaProxy.cpp
@@ -66,7 +66,7 @@ MxcMediaProxy::getVideoSurface() int MxcMediaProxy::orientation() const { - nhlog::ui()->debug("metadata: {}", availableMetaData().join(",").toStdString()); + nhlog::ui()->debug("metadata: {}", availableMetaData().join(QStringLiteral(",")).toStdString()); auto orientation = metaData(QMediaMetaData::Orientation).toInt(); nhlog::ui()->debug("Video orientation: {}", orientation); return orientation; @@ -93,16 +93,16 @@ MxcMediaProxy::startDownload() auto encryptionInfo = mtx::accessors::file(*event); // If the message is a link to a non mxcUrl, don't download it - if (!mxcUrl.startsWith("mxc://")) { + if (!mxcUrl.startsWith(QLatin1String("mxc://"))) { return; } QString suffix = QMimeDatabase().mimeTypeForName(mimeType).preferredSuffix(); const auto url = mxcUrl.toStdString(); - const auto name = QString(mxcUrl).remove("mxc://"); + const auto name = QString(mxcUrl).remove(QStringLiteral("mxc://")); QFileInfo filename( - QString("%1/media_cache/media/%2.%3") + QStringLiteral("%1/media_cache/media/%2.%3") .arg(QStandardPaths::writableLocation(QStandardPaths::CacheLocation), name, suffix)); if (QDir::cleanPath(name) != name) { nhlog::net()->warn("mxcUrl '{}' is not safe, not downloading file", url);