mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 22:26:32 +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;
|
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() << "****************************************************************************************";
|
// tLog() << "****************************************************************************************";
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user