mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 08:34:34 +02:00
Fixed starting Tomahawk with a track as cli-arg.
This commit is contained in:
@@ -706,6 +706,10 @@ TomahawkApp::onInfoSystemReady()
|
||||
#endif
|
||||
|
||||
initEnergyEventHandler();
|
||||
|
||||
if ( arguments().count() > 1 )
|
||||
loadUrl( arguments().last() );
|
||||
|
||||
emit tomahawkLoaded();
|
||||
}
|
||||
|
||||
@@ -879,20 +883,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();
|
||||
@@ -911,6 +908,9 @@ TomahawkApp::instanceStarted( KDSingleApplicationGuard::Instance instance )
|
||||
else
|
||||
activate();
|
||||
}
|
||||
else
|
||||
activate();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
|
Reference in New Issue
Block a user