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:
csoler 2015-01-26 19:56:32 +00:00
parent beb7c84898
commit a94465fd3a

View File

@ -506,6 +506,21 @@ void IdEditDialog::updateId()
mEditGroup.mMeta.mGroupName = groupname; 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; uint32_t dummyToken = 0;
rsIdentity->updateIdentity(dummyToken, mEditGroup); rsIdentity->updateIdentity(dummyToken, mEditGroup);