1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-30 19:00:12 +02:00

Display friend's avatars on Dashboard even when they are offline

* Fixes TWK-398
This commit is contained in:
Uwe L. Korn
2013-05-26 13:44:41 +02:00
parent 5d8b3647a2
commit 157880a752

View File

@@ -238,6 +238,19 @@ Source::avatar( TomahawkUtils::ImageMode style, const QSize& size )
break;
}
}
if ( result.isNull() )
{
// Try to get the avatar from the cache
// Hint: We store the avatar for each xmpp peer using its contactId, the dbFriendlyName is a contactId of a peer
QByteArray avatarBuffer = TomahawkUtils::Cache::instance()->getData( "Sources", dbFriendlyName() ).toByteArray();
if ( !avatarBuffer.isNull() )
{
QPixmap avatar;
avatar.loadFromData( avatarBuffer );
avatarBuffer.clear();
result = QPixmap( TomahawkUtils::createRoundedImage( avatar, QSize( 0, 0 ) ) );
}
}
// tLog() << "****************************************************************************************";
return result;
}