attempt to use a cache for user-defined avatars. Should reduce memory footprint. to be tested

This commit is contained in:
csoler 2019-06-03 23:52:29 +02:00
parent 807bbedd5a
commit e66fb923fb
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
25 changed files with 163 additions and 113 deletions

View file

@ -322,8 +322,8 @@ void ChatLobbyWidget::lobbyTreeWidgetCustomPopupMenu(QPoint)
QPixmap pixmap ;
if(idd.mAvatar.mSize == 0 || !pixmap.loadFromData(idd.mAvatar.mData, idd.mAvatar.mSize, "PNG"))
pixmap = QPixmap::fromImage(GxsIdDetails::makeDefaultIcon(*it)) ;
if(idd.mAvatar.mSize == 0 || !GxsIdDetails::loadPixmapFromData(idd.mAvatar.mData, idd.mAvatar.mSize, pixmap))
pixmap = GxsIdDetails::makeDefaultIcon(*it) ;
QAction *action = mnu->addAction(QIcon(pixmap), QString("%1 (%2)").arg(QString::fromUtf8(idd.mNickname.c_str()), QString::fromStdString((*it).toStdString())), this, SLOT(subscribeChatLobbyAs()));
action->setData(QString::fromStdString((*it).toStdString())) ;