radioapp/radioapplication/src/radioapplication.cpp
changeset 33 11b6825f0862
parent 32 189d20c34778
child 37 451b2e1545b2
child 41 3a6b55c6390c
--- a/radioapp/radioapplication/src/radioapplication.cpp	Wed Jun 23 18:12:57 2010 +0300
+++ b/radioapp/radioapplication/src/radioapplication.cpp	Tue Jul 06 14:16:27 2010 +0300
@@ -19,6 +19,8 @@
 #include <QTimer>
 #include <qsysteminfo.h>
 #include <HbDeviceMessageBox>
+#include <xqserviceutil.h>
+#include <HbSplashScreen>
 
 // User includes
 #include "radioapplication.h"
@@ -53,6 +55,10 @@
     LOG_TIMESTAMP( "Start radio" );
     setApplicationName( hbTrId( "txt_rad_title_fm_radio" ) );
 
+    if ( !XQServiceUtil::isService() ) {
+        HbSplashScreen::start();
+    }
+
     QTimer::singleShot( 0, this, SLOT(init()) );
 }
 
@@ -73,8 +79,7 @@
 void RadioApplication::init()
 {
     // If started as a service, there is no need for offline-check
-    const Hb::ActivationReason reason = activateReason();
-    bool okToStart = reason == Hb::ActivationReasonService;
+    bool okToStart = XQServiceUtil::isService();
     QScopedPointer<QtMobility::QSystemDeviceInfo> deviceInfo( new QtMobility::QSystemDeviceInfo() );
 
     if ( !okToStart ) {
@@ -91,9 +96,10 @@
 
     if ( okToStart ) {
 
-        // MainWindow needs to be alive to be able to show the offline query dialog.
-        // The window is only constructed half-way at this point because we may need to shut down if
-        // offline usage is not allowed
+        // Try to optimize startup time by launching the radio server process as soon as possible.
+        // This way the server and UI are being initialized at the same time and the startup is faster.
+//        RadioUiEngine::launchRadioServer();
+
         mMainWindow.reset( new RadioWindow() );
 
         CREATE_WIN32_TEST_WINDOW