Commit 3d3ada01 authored by Wescoeur's avatar Wescoeur

fix(app): execute command at startup correctly (not when core is restarted)

parent d4e89205
......@@ -173,6 +173,13 @@ void App::initContentApp () {
// Init core.
CoreManager::init(this, mParser->value("config"));
// Execute command argument if needed.
if (!mEngine) {
const QString commandArgument = getCommandArgument();
if (!commandArgument.isEmpty())
mCli->executeCommand(commandArgument);
}
// Init engine content.
mEngine = new QQmlApplicationEngine();
......@@ -215,13 +222,6 @@ void App::initContentApp () {
if (mEngine->rootObjects().isEmpty())
qFatal("Unable to open main window.");
// Execute command argument if needed.
{
const QString commandArgument = getCommandArgument();
if (!commandArgument.isEmpty())
mCli->executeCommand(commandArgument);
}
QObject::connect(
CoreManager::getInstance()->getHandlers().get(),
&CoreHandlers::coreStarted,
......@@ -551,13 +551,6 @@ void App::openAppAfterInit () {
}
}
// Execute command argument if needed.
{
const QString commandArgument = getCommandArgument();
if (!commandArgument.isEmpty())
mCli->executeCommand(commandArgument);
}
#ifdef ENABLE_UPDATE_CHECK
QTimer *timer = new QTimer(mEngine);
timer->setInterval(VERSION_UPDATE_CHECK_INTERVAL);
......
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