summary refs log tree commit diff
path: root/src/dialogs/ReadReceipts.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/dialogs/ReadReceipts.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/dialogs/ReadReceipts.cpp')
-rw-r--r--src/dialogs/ReadReceipts.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/dialogs/ReadReceipts.cpp b/src/dialogs/ReadReceipts.cpp

index 5a0d98c7..58ad59c3 100644 --- a/src/dialogs/ReadReceipts.cpp +++ b/src/dialogs/ReadReceipts.cpp
@@ -37,8 +37,7 @@ ReceiptItem::ReceiptItem(QWidget *parent, auto displayName = Cache::displayName(room_id, user_id); - avatar_ = new Avatar(this); - avatar_->setSize(44); + avatar_ = new Avatar(this, 44); avatar_->setLetter(utils::firstChar(displayName)); // If it's a matrix id we use the second letter. @@ -56,10 +55,7 @@ ReceiptItem::ReceiptItem(QWidget *parent, topLayout_->addWidget(avatar_); topLayout_->addLayout(textLayout_, 1); - AvatarProvider::resolve(ChatPage::instance()->currentRoom(), - user_id, - this, - [this](const QImage &img) { avatar_->setImage(img); }); + avatar_->setImage(ChatPage::instance()->currentRoom(), user_id); } void