From 98354d169351a27d02164f2c9e7ea7210b51db33 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Thu, 20 Jun 2013 09:31:31 +0200 Subject: [PATCH] * Make sure JSResolver always has at least the default resolver icon set. --- src/libtomahawk/resolvers/JSResolver.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libtomahawk/resolvers/JSResolver.cpp b/src/libtomahawk/resolvers/JSResolver.cpp index 9ea63cdf4..c72ca7ba9 100644 --- a/src/libtomahawk/resolvers/JSResolver.cpp +++ b/src/libtomahawk/resolvers/JSResolver.cpp @@ -513,7 +513,7 @@ JSResolver::init() bool compressed = m.value( "compressed", "false" ).toString() == "true"; QByteArray icoData = m.value( "icon" ).toByteArray(); - if( compressed ) + if ( compressed ) icoData = qUncompress( QByteArray::fromBase64( icoData ) ); else icoData = QByteArray::fromBase64( icoData ); @@ -533,6 +533,11 @@ JSResolver::init() QString iconPath = QFileInfo( filePath() ).path() + "/" + m.value( "icon" ).toString(); success = m_icon.load( iconPath ); } + // if we still couldn't load the cover, set the default resolver icon + if ( m_icon.isNull() ) + { + m_icon = TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultResolver, TomahawkUtils::Original, QSize( 128, 128 ) ); + } // load config widget and apply settings loadUi();