diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-06-17 15:28:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-17 15:28:01 +0200 |
commit | 621dfbf39f9d08be5a24070d9e222e4c3e522728 (patch) | |
tree | f2ecc0ee612c79fff81339c353311f5df8a15f00 /lib/avatar.cpp | |
parent | cc69883ef7219ec42cb7bdb2e3d66256c17a6532 (diff) | |
parent | 3581b9d03fe2f169909b3977606abd3b459c0529 (diff) | |
download | libquotient-621dfbf39f9d08be5a24070d9e222e4c3e522728.tar.gz libquotient-621dfbf39f9d08be5a24070d9e222e4c3e522728.zip |
Merge #562: Build with Qt 5.15 and Qt 6
Diffstat (limited to 'lib/avatar.cpp')
-rw-r--r-- | lib/avatar.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/avatar.cpp b/lib/avatar.cpp index 9304a3de..13de99bf 100644 --- a/lib/avatar.cpp +++ b/lib/avatar.cpp @@ -39,7 +39,7 @@ public: // The below are related to image caching, hence mutable mutable QImage _originalImage; - mutable std::vector<QPair<QSize, QImage>> _scaledImages; + mutable std::vector<std::pair<QSize, QImage>> _scaledImages; mutable QSize _requestedSize; mutable enum { Unknown, Cache, Network, Banned } _imageSource = Unknown; mutable QPointer<MediaThumbnailJob> _thumbnailRequest = nullptr; @@ -124,9 +124,9 @@ QImage Avatar::Private::get(Connection* connection, QSize size, }); } - for (const auto& p : _scaledImages) - if (p.first == size) - return p.second; + for (const auto& [scaledSize, scaledImage] : _scaledImages) + if (scaledSize == size) + return scaledImage; auto result = _originalImage.isNull() ? QImage() : _originalImage.scaled(size, Qt::KeepAspectRatio, |