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
|
#endif
|
||||||
|
|
||||||
initEnergyEventHandler();
|
initEnergyEventHandler();
|
||||||
|
|
||||||
|
if ( arguments().count() > 1 )
|
||||||
|
loadUrl( arguments().last() );
|
||||||
|
|
||||||
emit tomahawkLoaded();
|
emit tomahawkLoaded();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -879,20 +883,13 @@ TomahawkApp::instanceStarted( KDSingleApplicationGuard::Instance instance )
|
|||||||
tDebug( LOGINFO ) << "Instance started!" << instance.pid() << instance.arguments();
|
tDebug( LOGINFO ) << "Instance started!" << instance.pid() << instance.arguments();
|
||||||
const QStringList arguments = instance.arguments();
|
const QStringList arguments = instance.arguments();
|
||||||
|
|
||||||
if ( arguments.size() < 2 )
|
if ( arguments.count() > 1 )
|
||||||
|
{
|
||||||
|
if ( loadUrl( arguments.last() ) )
|
||||||
{
|
{
|
||||||
activate();
|
activate();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
else if ( arguments.contains( "--next" ) )
|
||||||
QString lastArg = arguments[ arguments.size() - 1 ];
|
|
||||||
if ( loadUrl( lastArg ) )
|
|
||||||
{
|
|
||||||
activate();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( arguments.contains( "--next" ) )
|
|
||||||
AudioEngine::instance()->next();
|
AudioEngine::instance()->next();
|
||||||
else if ( arguments.contains( "--prev" ) )
|
else if ( arguments.contains( "--prev" ) )
|
||||||
AudioEngine::instance()->previous();
|
AudioEngine::instance()->previous();
|
||||||
@@ -911,6 +908,9 @@ TomahawkApp::instanceStarted( KDSingleApplicationGuard::Instance instance )
|
|||||||
else
|
else
|
||||||
activate();
|
activate();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
activate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Reference in New Issue
Block a user