summary refs log tree commit diff
path: root/src/RoomInfoListItem.cpp
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2019-08-30 23:15:09 +0000
committerGitHub <noreply@github.com>2019-08-30 23:15:09 +0000
commit5be967fb1df73fa495f9336f60fd409a011ff4ec (patch)
treeb42e8bd533279f428de3791ae5bab953137e7add /src/RoomInfoListItem.cpp
parentFix themeing issues on mentions (diff)
parentFix usage of deprecated find (diff)
downloadnheko-5be967fb1df73fa495f9336f60fd409a011ff4ec.tar.xz
Merge pull request #86 from Nheko-Reborn/avatar-memory-usage
Try to reduce memory usage by reusing avatar pixmaps
Diffstat (limited to 'src/RoomInfoListItem.cpp')
-rw-r--r--src/RoomInfoListItem.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/RoomInfoListItem.cpp b/src/RoomInfoListItem.cpp

index 9bcce134..dbcd6806 100644 --- a/src/RoomInfoListItem.cpp +++ b/src/RoomInfoListItem.cpp
@@ -21,6 +21,7 @@ #include <QPainter> #include <QtGlobal> +#include "AvatarProvider.h" #include "Cache.h" #include "Config.h" #include "RoomInfoListItem.h" @@ -434,10 +435,12 @@ RoomInfoListItem::mousePressEvent(QMouseEvent *event) } void -RoomInfoListItem::setAvatar(const QImage &img) +RoomInfoListItem::setAvatar(const QString &avatar_url) { - roomAvatar_ = utils::scaleImageToPixmap(img, IconSize); - update(); + AvatarProvider::resolve(avatar_url, IconSize, this, [this](const QPixmap &img) { + roomAvatar_ = img; + update(); + }); } void