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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user