diff --git a/src/app/App.cpp b/src/app/App.cpp index 09e43ba7a..3739b64bd 100644 --- a/src/app/App.cpp +++ b/src/app/App.cpp @@ -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);