summary refs log tree commit diff
path: root/src/ui/MxcAnimatedImage.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-12-29 07:40:32 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-12-29 07:40:32 +0100
commitf21bf5f97e6d52534f24ba9c0cad66105bdb5122 (patch)
treec8d87186d8b2298489a9c96a322a618150c5bb31 /src/ui/MxcAnimatedImage.cpp
parentPretty up code with fewer allocations (diff)
downloadnheko-f21bf5f97e6d52534f24ba9c0cad66105bdb5122.tar.xz
Cache supported animated image formats
Diffstat (limited to 'src/ui/MxcAnimatedImage.cpp')
-rw-r--r--src/ui/MxcAnimatedImage.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ui/MxcAnimatedImage.cpp b/src/ui/MxcAnimatedImage.cpp
index 8e39558f..3c82c614 100644
--- a/src/ui/MxcAnimatedImage.cpp
+++ b/src/ui/MxcAnimatedImage.cpp
@@ -33,7 +33,8 @@ MxcAnimatedImage::startDownload()
 
     QByteArray mimeType = QString::fromStdString(mtx::accessors::mimetype(*event)).toUtf8();
 
-    animatable_ = QMovie::supportedFormats().contains(mimeType.split('/').back());
+    static const auto formats = QMovie::supportedFormats();
+    animatable_               = formats.contains(mimeType.split('/').back());
     animatableChanged();
 
     if (!animatable_)