1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-01 20:00:13 +02:00

Support the legacy api that sends the path to the resolver icon file

This commit is contained in:
Kilian Lackhove
2013-01-04 18:01:22 +01:00
parent 9a4cdf1865
commit f64c6428cf
2 changed files with 14 additions and 0 deletions

View File

@@ -342,6 +342,13 @@ QtScriptResolver::init()
m_icon = ico.scaled( m_icon.size(), Qt::IgnoreAspectRatio );
success = true;
}
// see if the resolver sent an icon path to not break the old (unofficial) api.
// TODO: remove this and publish a definitive api
if ( !success )
{
QString iconPath = QFileInfo( filePath() ).path() + "/" + m.value( "icon" ).toString();
success = m_icon.load( iconPath );
}
// load config widget and apply settings
loadUi();

View File

@@ -392,6 +392,13 @@ ScriptResolver::doSetup( const QVariantMap& m )
m_icon = ico.scaled( m_icon.size(), Qt::IgnoreAspectRatio );
success = true;
}
// see if the resolver sent an icon path to not break the old (unofficial) api.
// TODO: remove this and publish a definitive api
if ( !success )
{
QString iconPath = QFileInfo( filePath() ).path() + "/" + m.value( "icon" ).toString();
success = m_icon.load( iconPath );
}
qDebug() << "SCRIPT" << filePath() << "READY," << "name" << m_name << "weight" << m_weight << "timeout" << m_timeout << "icon received" << success;