mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
allow to change own avatar for already existing identity.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7879 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
beb7c84898
commit
a94465fd3a
@ -506,6 +506,21 @@ void IdEditDialog::updateId()
|
||||
|
||||
mEditGroup.mMeta.mGroupName = groupname;
|
||||
|
||||
const QPixmap *pixmap = ui.avatarLabel->pixmap();
|
||||
|
||||
if (!pixmap->isNull())
|
||||
{
|
||||
QByteArray ba;
|
||||
QBuffer buffer(&ba);
|
||||
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
pixmap->save(&buffer, "PNG"); // writes image into ba in PNG format
|
||||
|
||||
mEditGroup.mImage.copy((uint8_t *) ba.data(), ba.size());
|
||||
}
|
||||
else
|
||||
mEditGroup.mImage.clear();
|
||||
|
||||
uint32_t dummyToken = 0;
|
||||
rsIdentity->updateIdentity(dummyToken, mEditGroup);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user