1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-11 16:44:05 +02:00

Fixed starting Tomahawk with a track as cli-arg.

This commit is contained in:
Christian Muehlhaeuser
2015-04-13 07:00:03 +02:00
parent 2c65bcff7e
commit e096f62b5c

View File

@@ -713,6 +713,10 @@ TomahawkApp::onInfoSystemReady()
#endif
initEnergyEventHandler();
if ( arguments().count() > 1 )
loadUrl( arguments().last() );
emit tomahawkLoaded();
}
@@ -886,20 +890,13 @@ TomahawkApp::instanceStarted( KDSingleApplicationGuard::Instance instance )
tDebug( LOGINFO ) << "Instance started!" << instance.pid() << instance.arguments();
const QStringList arguments = instance.arguments();
if ( arguments.size() < 2 )
if ( arguments.count() > 1 )
{
if ( loadUrl( arguments.last() ) )
{
activate();
return;
}
QString lastArg = arguments[ arguments.size() - 1 ];
if ( loadUrl( lastArg ) )
{
activate();
return;
}
if ( arguments.contains( "--next" ) )
else if ( arguments.contains( "--next" ) )
AudioEngine::instance()->next();
else if ( arguments.contains( "--prev" ) )
AudioEngine::instance()->previous();
@@ -918,6 +915,9 @@ TomahawkApp::instanceStarted( KDSingleApplicationGuard::Instance instance )
else
activate();
}
else
activate();
}
void