Commit 708255c0 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(src/app): do not display splashscreen when selftest option is used

parent 273c0563
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<context> <context>
<name>App</name> <name>App</name>
<message> <message>
<source>selftestResult</source> <source>selfTestResult</source>
<translation>Linphone seems to be running correctly.</translation> <translation>Linphone seems to be running correctly.</translation>
</message> </message>
<message> <message>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<translation>Specify the linphone configuration file to use.</translation> <translation>Specify the linphone configuration file to use.</translation>
</message> </message>
<message> <message>
<source>commandLineOptionSelftest</source> <source>commandLineOptionSelfTest</source>
<translation>Run self test and exit 0 if it succeeded.</translation> <translation>Run self test and exit 0 if it succeeded.</translation>
</message> </message>
<message> <message>
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<context> <context>
<name>App</name> <name>App</name>
<message> <message>
<source>selftestResult</source> <source>selfTestResult</source>
<translation>Linphone semble fonctionner normalement.</translation> <translation>Linphone semble fonctionner normalement.</translation>
</message> </message>
<message> <message>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<translation>Spécifier un fichier de configuration à utiliser.</translation> <translation>Spécifier un fichier de configuration à utiliser.</translation>
</message> </message>
<message> <message>
<source>commandLineOptionSelftest</source> <source>commandLineOptionSelfTest</source>
<translation>Éxécuter un test automatique et retourner 0 en cas de succès.</translation> <translation>Éxécuter un test automatique et retourner 0 en cas de succès.</translation>
</message> </message>
<message> <message>
......
...@@ -176,12 +176,14 @@ void App::initContentApp () { ...@@ -176,12 +176,14 @@ void App::initContentApp () {
qFatal("Unable to open main window."); qFatal("Unable to open main window.");
// Load splashscreen. // Load splashscreen.
activeSplashScreen(this); bool selfTest = mParser.isSet("self-test");
if (!selfTest)
activeSplashScreen(this);
QObject::connect( QObject::connect(
CoreManager::getInstance()->getHandlers().get(), CoreManager::getInstance()->getHandlers().get(),
&CoreHandlers::coreStarted, &CoreHandlers::coreStarted,
this, mParser.isSet("selftest") ? &App::quit : &App::openAppAfterInit this, selfTest ? &App::quit : &App::openAppAfterInit
); );
} }
...@@ -196,7 +198,7 @@ void App::parseArgs () { ...@@ -196,7 +198,7 @@ void App::parseArgs () {
#ifndef __APPLE__ #ifndef __APPLE__
{ "iconified", tr("commandLineOptionIconified") }, { "iconified", tr("commandLineOptionIconified") },
#endif // ifndef __APPLE__ #endif // ifndef __APPLE__
{ "selftest", tr("commandLineOptionSelftest") }, { "self-test", tr("commandLineOptionSelfTest") },
{ { "V", "verbose" }, tr("commandLineOptionVerbose") } { { "V", "verbose" }, tr("commandLineOptionVerbose") }
}); });
...@@ -459,8 +461,8 @@ void App::openAppAfterInit () { ...@@ -459,8 +461,8 @@ void App::openAppAfterInit () {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void App::quit () { void App::quit () {
if (mParser.isSet("selftest")) if (mParser.isSet("self-test"))
cout << tr("selftestResult").toStdString() << endl; cout << tr("selfTestResult").toStdString() << endl;
QApplication::quit(); QApplication::quit();
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment