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

If a tomahawk link has a xspf, be sure to load it from GAM.

This commit is contained in:
Teo Mrnjavac
2013-12-19 17:39:57 +01:00
parent 60d6ec3789
commit c18d8568c7

View File

@@ -719,23 +719,26 @@ TomahawkApp::activate()
bool bool
TomahawkApp::loadUrl( const QString& url ) TomahawkApp::loadUrl( const QString& url )
{ {
QFile f( url ); if ( !url.startsWith( "tomahawk://" ) )
QFileInfo info( f );
if ( info.suffix() == "xspf" )
{ {
XSPFLoader* l = new XSPFLoader( true, this ); QFile f( url );
tDebug( LOGINFO ) << "Loading spiff:" << url; QFileInfo info( f );
l->load( QUrl::fromUserInput( url ) ); if ( info.suffix() == "xspf" )
{
XSPFLoader* l = new XSPFLoader( true, this );
tDebug( LOGINFO ) << "Loading spiff:" << url;
l->load( QUrl::fromUserInput( url ) );
return true; return true;
} }
else if ( info.suffix() == "jspf" ) else if ( info.suffix() == "jspf" )
{ {
JSPFLoader* l = new JSPFLoader( true, this ); JSPFLoader* l = new JSPFLoader( true, this );
tDebug( LOGINFO ) << "Loading j-spiff:" << url; tDebug( LOGINFO ) << "Loading j-spiff:" << url;
l->load( QUrl::fromUserInput( url ) ); l->load( QUrl::fromUserInput( url ) );
return true; return true;
}
} }
return GlobalActionManager::instance()->openUrl( url ); return GlobalActionManager::instance()->openUrl( url );