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