From 8b95f7330b8b6ad244e1decfc5de3913cf6006eb Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Mon, 2 May 2011 22:17:53 -0400 Subject: [PATCH] also send args on first startup, not completely working --- src/main.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index b55cf2800..01ebdcc39 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -45,16 +45,22 @@ main( int argc, char *argv[] ) TomahawkApp a( argc, argv ); KDSingleApplicationGuard guard( &a, KDSingleApplicationGuard::AutoKillOtherInstances ); QObject::connect( &guard, SIGNAL( instanceStarted( KDSingleApplicationGuard::Instance ) ), &a, SLOT( instanceStarted( KDSingleApplicationGuard::Instance ) ) ); - + if ( guard.isPrimaryInstance() ) a.init(); - + QString locale = QLocale::system().name(); QTranslator translator; translator.load( QString( ":/lang/tomahawk_" ) + locale ); a.installTranslator( &translator ); + if ( argc > 1 ) + { + QString arg = a.arguments()[ 1 ]; + a.loadUrl( arg ); + } + return a.exec(); }