1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

remove avatar debug prints

This commit is contained in:
dubslow 2014-09-29 16:36:23 -05:00
parent bf25d84e04
commit 39abf83b2e

View File

@ -563,21 +563,14 @@ void Core::onAvatarInfoCallback(Tox*, int32_t friendnumber, uint8_t format,
Core* core = static_cast<Core*>(_core); Core* core = static_cast<Core*>(_core);
if (format == TOX_AVATAR_FORMAT_NONE) if (format == TOX_AVATAR_FORMAT_NONE)
{
qDebug() << "Core: Got null avatar info from" << friendnumber;
emit core->friendAvatarRemoved(friendnumber); emit core->friendAvatarRemoved(friendnumber);
}
else else
{ {
QByteArray oldHash = Settings::getInstance().getAvatarHash(core->getFriendAddress(friendnumber)); QByteArray oldHash = Settings::getInstance().getAvatarHash(core->getFriendAddress(friendnumber));
if (QByteArray((char*)hash, TOX_HASH_LENGTH) != oldHash) // comparison failed miserably if I didn't convert hash to QByteArray if (QByteArray((char*)hash, TOX_HASH_LENGTH) != oldHash)
{ // comparison failed miserably if I didn't convert hash to QByteArray
qDebug() << "Core: got different avatar hash from" << friendnumber;
tox_request_avatar_data(core->tox, friendnumber); tox_request_avatar_data(core->tox, friendnumber);
} }
else
qDebug() << "Core: Got old avatar info from" << friendnumber;
}
} }
void Core::onAvatarDataCallback(Tox*, int32_t friendnumber, uint8_t, void Core::onAvatarDataCallback(Tox*, int32_t friendnumber, uint8_t,
@ -585,11 +578,8 @@ void Core::onAvatarDataCallback(Tox*, int32_t friendnumber, uint8_t,
{ {
QPixmap pic; QPixmap pic;
pic.loadFromData((uchar*)data, datalen); pic.loadFromData((uchar*)data, datalen);
if (pic.isNull()) if (!pic.isNull())
qDebug() << "Core: Got null avatar from "<<friendnumber;
else
{ {
qDebug() << "Core: Got avatar data from "<<friendnumber<<", size:"<<pic.size();
Settings::getInstance().saveAvatar(pic, static_cast<Core*>(core)->getFriendAddress(friendnumber)); Settings::getInstance().saveAvatar(pic, static_cast<Core*>(core)->getFriendAddress(friendnumber));
Settings::getInstance().saveAvatarHash(QByteArray((char*)hash, TOX_HASH_LENGTH), static_cast<Core*>(core)->getFriendAddress(friendnumber)); Settings::getInstance().saveAvatarHash(QByteArray((char*)hash, TOX_HASH_LENGTH), static_cast<Core*>(core)->getFriendAddress(friendnumber));
emit static_cast<Core*>(core)->friendAvatarChanged(friendnumber, pic); emit static_cast<Core*>(core)->friendAvatarChanged(friendnumber, pic);