1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 11:20:22 +02:00

Don't overwrite previously set resolver icon.

This commit is contained in:
Christian Muehlhaeuser
2015-04-05 17:35:27 +02:00
parent 325d4ca67a
commit c36bd64a01

View File

@@ -418,7 +418,7 @@ ScriptResolver::doSetup( const QVariantMap& m )
m_capabilities = static_cast< Capabilities >( intCap ); m_capabilities = static_cast< Capabilities >( intCap );
QByteArray icoData = m.value( "icon" ).toByteArray(); QByteArray icoData = m.value( "icon" ).toByteArray();
if( compressed ) if ( compressed )
icoData = qUncompress( QByteArray::fromBase64( icoData ) ); icoData = qUncompress( QByteArray::fromBase64( icoData ) );
else else
icoData = QByteArray::fromBase64( icoData ); icoData = QByteArray::fromBase64( icoData );
@@ -435,8 +435,12 @@ ScriptResolver::doSetup( const QVariantMap& m )
// TODO: remove this and publish a definitive api // TODO: remove this and publish a definitive api
if ( !success ) if ( !success )
{ {
QString iconPath = QFileInfo( filePath() ).path() + "/" + m.value( "icon" ).toString(); const QString iconPath = QFileInfo( filePath() ).path() + "/" + m.value( "icon" ).toString();
success = m_icon.load( iconPath ); 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; qDebug() << "SCRIPT" << filePath() << "READY," << "name" << m_name << "weight" << m_weight << "timeout" << m_timeout << "icon received" << success;