1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-09 15:47:38 +02:00

* Support passing a local file as parameter to a running Tomahawk instance, which in turn triggers playback.

This commit is contained in:
Christian Muehlhaeuser
2014-09-09 17:32:24 +02:00
parent cda5d833dd
commit 1cd96b8a74

View File

@@ -795,6 +795,21 @@ TomahawkApp::loadUrl( const QString& url )
return true;
}
}
else if ( TomahawkUtils::supportedExtensions().contains( info.suffix().toLower() ) )
{
if ( info.exists() )
{
QString furl = url;
if ( furl.startsWith( "file://" ) )
furl = furl.right( furl.length() - 7 );
AudioEngine::instance()->play( QUrl::fromLocalFile( furl ) );
return true;
}
tDebug() << Q_FUNC_INFO << "Unable to find:" << info.absoluteFilePath();
return false;
}
}
return GlobalActionManager::instance()->openUrl( url );