mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-13 17:43:59 +02:00
[0.9 api]Support non-relative icon paths
This commit is contained in:
@@ -252,6 +252,20 @@ ScriptCollection::parseMetaData( const QVariantMap& metadata )
|
|||||||
bool ok = iconPixmap.load( iconPath );
|
bool ok = iconPixmap.load( iconPath );
|
||||||
if ( ok && !iconPixmap.isNull() )
|
if ( ok && !iconPixmap.isNull() )
|
||||||
setIcon( iconPixmap );
|
setIcon( iconPixmap );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//see if it is a new way of specifying path
|
||||||
|
//like "contents/images/icon.png"
|
||||||
|
iconPath = QFileInfo( scriptAccount()->filePath() ).path();
|
||||||
|
for(int i = 0; i < 3 && !ok ; ++i)
|
||||||
|
{
|
||||||
|
iconPath += "/../";
|
||||||
|
ok = iconPixmap.load(iconPath + metadata.value("iconfile").toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ok && !iconPixmap.isNull() )
|
||||||
|
setIcon( iconPixmap );
|
||||||
|
}
|
||||||
|
|
||||||
fetchIcon( metadata.value( "iconurl" ).toString() );
|
fetchIcon( metadata.value( "iconurl" ).toString() );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user