mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-11-29 11:56:37 -05:00
added various sizes in icons cache so that we do not always allocate the largest sizes
This commit is contained in:
parent
e66fb923fb
commit
94cbe65142
18 changed files with 107 additions and 64 deletions
|
|
@ -41,7 +41,7 @@ void AvatarDefs::getOwnAvatar(QPixmap &avatar, const QString& defaultImage)
|
|||
}
|
||||
|
||||
/* load image */
|
||||
GxsIdDetails::loadPixmapFromData(data, size, avatar) ;
|
||||
GxsIdDetails::loadPixmapFromData(data, size, avatar,GxsIdDetails::ORIGINAL) ;
|
||||
|
||||
free(data);
|
||||
}
|
||||
|
|
@ -58,7 +58,7 @@ void AvatarDefs::getAvatarFromSslId(const RsPeerId& sslId, QPixmap &avatar, cons
|
|||
}
|
||||
|
||||
/* load image */
|
||||
GxsIdDetails::loadPixmapFromData(data, size, avatar) ;
|
||||
GxsIdDetails::loadPixmapFromData(data, size, avatar, GxsIdDetails::LARGE) ;
|
||||
|
||||
free(data);
|
||||
}
|
||||
|
|
@ -77,8 +77,8 @@ void AvatarDefs::getAvatarFromGxsId(const RsGxsId& gxsId, QPixmap &avatar, const
|
|||
|
||||
/* load image */
|
||||
|
||||
if(details.mAvatar.mSize == 0 || !GxsIdDetails::loadPixmapFromData(details.mAvatar.mData, details.mAvatar.mSize, avatar))
|
||||
avatar = GxsIdDetails::makeDefaultIcon(gxsId);
|
||||
if(details.mAvatar.mSize == 0 || !GxsIdDetails::loadPixmapFromData(details.mAvatar.mData, details.mAvatar.mSize, avatar,GxsIdDetails::LARGE))
|
||||
avatar = GxsIdDetails::makeDefaultIcon(gxsId,GxsIdDetails::LARGE);
|
||||
}
|
||||
|
||||
void AvatarDefs::getAvatarFromGpgId(const RsPgpId& gpgId, QPixmap &avatar, const QString& defaultImage)
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@ AvatarDialog::AvatarDialog(QWidget *parent) :
|
|||
updateInterface();
|
||||
}
|
||||
|
||||
const int AvatarDialog::RS_AVATAR_IMAGE_W = 128;
|
||||
const int AvatarDialog::RS_AVATAR_IMAGE_H = 128;
|
||||
const int AvatarDialog::RS_AVATAR_DEFAULT_IMAGE_W = 64;
|
||||
const int AvatarDialog::RS_AVATAR_DEFAULT_IMAGE_H = 64;
|
||||
|
||||
AvatarDialog::~AvatarDialog()
|
||||
{
|
||||
|
|
@ -55,7 +55,7 @@ AvatarDialog::~AvatarDialog()
|
|||
|
||||
void AvatarDialog::changeAvatar()
|
||||
{
|
||||
QPixmap img = misc::getOpenThumbnailedPicture(this, tr("Load Avatar"), RS_AVATAR_IMAGE_W,RS_AVATAR_IMAGE_H);
|
||||
QPixmap img = misc::getOpenThumbnailedPicture(this, tr("Load Avatar"), RS_AVATAR_DEFAULT_IMAGE_W,RS_AVATAR_DEFAULT_IMAGE_H);
|
||||
|
||||
if (img.isNull())
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ class AvatarDialog : public QDialog
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static const int RS_AVATAR_IMAGE_W ;
|
||||
static const int RS_AVATAR_IMAGE_H ;
|
||||
static const int RS_AVATAR_DEFAULT_IMAGE_W ;
|
||||
static const int RS_AVATAR_DEFAULT_IMAGE_H ;
|
||||
|
||||
AvatarDialog(QWidget *parent = 0);
|
||||
~AvatarDialog();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue