src/hbcore/gui/hbsplashscreen.cpp
changeset 28 b7da29130b0e
parent 23 e6ad4ef83b23
child 30 80e4d18b72f5
equal deleted inserted replaced
23:e6ad4ef83b23 28:b7da29130b0e
   129 #else
   129 #else
   130     return true;
   130     return true;
   131 #endif
   131 #endif
   132 }
   132 }
   133 
   133 
   134 // Called when QApplication is constructed and the splash was launched
   134 // Called (by HbApplication) when QApplication is constructed and the splash was
   135 // before that. This gives a chance for the splash screen to do
   135 // launched before that. This gives a chance for the splash screen to do
   136 // activies that need an active scheduler or a QApplication instance.
   136 // activies that need an active scheduler or a QApplication instance.
   137 void HbSplashScreenExt::doQtPhase()
   137 void HbSplashScreenExt::doQtPhase()
   138 {
   138 {
       
   139     // Can also be called when the splash screen was not started or is already
       
   140     // destroyed, do nothing in such cases.
   139     if (splashScreen) {
   141     if (splashScreen) {
   140 #ifdef HB_SPLASH_DIRECT_WS
   142 #ifdef HB_SPLASH_DIRECT_WS
   141         static_cast<HbSplashScreenSymbianVg *>(splashScreen)->doQtPhase();
   143         static_cast<HbSplashScreenSymbianVg *>(splashScreen)->doQtPhase();
   142 #endif
   144 #endif
   143     }
   145     }
   579 
   581 
   580 #ifdef HB_SPLASH_VERBOSE_LOGGING
   582 #ifdef HB_SPLASH_VERBOSE_LOGGING
   581             RDebug::Printf("[hbsplash] drawing took %d ms", (int) t.elapsed());
   583             RDebug::Printf("[hbsplash] drawing took %d ms", (int) t.elapsed());
   582 #endif
   584 #endif
   583 
   585 
       
   586             bool isQtAvailable = QCoreApplication::instance() != 0;
       
   587 #ifdef HB_SPLASH_VERBOSE_LOGGING
       
   588             RDebug::Printf("[hbsplash] qapplication present: %d", isQtAvailable);
       
   589 #endif
       
   590             if (isQtAvailable) {
       
   591                 doQtPhase();
       
   592             }
       
   593             // If there is no QApplication then there is no active scheduler,
       
   594             // cone, etc. either so defer the creation of the timer and the
       
   595             // visibility listener. doQtPhase() will be called later by
       
   596             // HbApplication when QApplication is constructed. If HbApplication
       
   597             // is not used at all and start() is called before instantiating
       
   598             // QApplication then doQtPhase() is never called but there is not
       
   599             // much we can do and it is not mandatory anyway.
       
   600 
   584         } else {
   601         } else {
   585             HbSplashScreen::destroy();
   602             HbSplashScreen::destroy();
   586         }
   603         }
   587     }
   604     }
   588 }
   605 }