From 371d787b46c0a274c3761fe269bf58acc347c77b Mon Sep 17 00:00:00 2001 From: Kilian Lackhove Date: Wed, 12 Sep 2012 16:30:55 +0200 Subject: [PATCH] show user-avatar fallback if no avatar was found --- src/libtomahawk/Result.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libtomahawk/Result.cpp b/src/libtomahawk/Result.cpp index efaeb3dab..4a8bbf03c 100644 --- a/src/libtomahawk/Result.cpp +++ b/src/libtomahawk/Result.cpp @@ -28,6 +28,7 @@ #include "database/DatabaseCommand_AllTracks.h" #include "database/DatabaseCommand_AddFiles.h" +#include "utils/TomahawkUtilsGui.h" #include "utils/Logger.h" using namespace Tomahawk; @@ -304,7 +305,12 @@ Result::sourceIcon() const } else { - return collection()->source()->avatar( Source::FancyStyle ); + QPixmap avatar = collection()->source()->avatar( Source::FancyStyle ); + if ( !avatar ) + { + avatar = TomahawkUtils::createAvatarFrame( QPixmap( RESPATH "images/user-avatar.png" ) ); + } + return avatar; } }