From c36bd64a01644d83c041d61b6d063c73be60231b Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sun, 5 Apr 2015 17:35:27 +0200 Subject: [PATCH] Don't overwrite previously set resolver icon. --- src/libtomahawk/resolvers/ScriptResolver.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/libtomahawk/resolvers/ScriptResolver.cpp b/src/libtomahawk/resolvers/ScriptResolver.cpp index 605423e8a..f17fb1a92 100644 --- a/src/libtomahawk/resolvers/ScriptResolver.cpp +++ b/src/libtomahawk/resolvers/ScriptResolver.cpp @@ -418,7 +418,7 @@ ScriptResolver::doSetup( const QVariantMap& m ) m_capabilities = static_cast< Capabilities >( intCap ); QByteArray icoData = m.value( "icon" ).toByteArray(); - if( compressed ) + if ( compressed ) icoData = qUncompress( QByteArray::fromBase64( icoData ) ); else icoData = QByteArray::fromBase64( icoData ); @@ -435,8 +435,12 @@ ScriptResolver::doSetup( const QVariantMap& m ) // TODO: remove this and publish a definitive api if ( !success ) { - QString iconPath = QFileInfo( filePath() ).path() + "/" + m.value( "icon" ).toString(); - success = m_icon.load( iconPath ); + const QString iconPath = QFileInfo( filePath() ).path() + "/" + m.value( "icon" ).toString(); + QPixmap icon; + icon.load( iconPath ); + success = icon.load( iconPath ); + if ( success ) + m_icon = icon; } qDebug() << "SCRIPT" << filePath() << "READY," << "name" << m_name << "weight" << m_weight << "timeout" << m_timeout << "icon received" << success;