fix(win32): Create QApp Early as possible
This commit is contained in:
parent
13f98475a2
commit
c26717f38a
2 changed files with 4 additions and 10 deletions
|
|
@ -70,11 +70,6 @@ App *createApp(const CoreArgParser &parser, EventQueue &events, const QString &p
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
{
|
|
||||||
// HACK to make sure settings gets the correct qApp path
|
|
||||||
QCoreApplication m(argc, argv);
|
|
||||||
}
|
|
||||||
|
|
||||||
ArchMiscWindows::setInstanceWin32(GetModuleHandle(nullptr));
|
ArchMiscWindows::setInstanceWin32(GetModuleHandle(nullptr));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -126,9 +121,8 @@ int main(int argc, char **argv)
|
||||||
const auto processName = QFileInfo(argv[0]).fileName();
|
const auto processName = QFileInfo(argv[0]).fileName();
|
||||||
|
|
||||||
App *coreApp = createApp(parser, events, processName);
|
App *coreApp = createApp(parser, events, processName);
|
||||||
|
|
||||||
QApplication app(argc, argv);
|
|
||||||
QApplication::setApplicationName(QStringLiteral("%1 Core").arg(kAppName));
|
QApplication::setApplicationName(QStringLiteral("%1 Core").arg(kAppName));
|
||||||
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
const auto ipcServer = new deskflow::core::ipc::CoreIpcServer(&app); // NOSONAR - Qt managed
|
const auto ipcServer = new deskflow::core::ipc::CoreIpcServer(&app); // NOSONAR - Qt managed
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,9 @@ int main(int argc, char **argv)
|
||||||
ArchMiscWindows::setInstanceWin32(GetModuleHandle(nullptr));
|
ArchMiscWindows::setInstanceWin32(GetModuleHandle(nullptr));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
QCoreApplication::setApplicationName(QStringLiteral("%1 Daemon").arg(kAppName));
|
||||||
|
QCoreApplication app(argc, argv);
|
||||||
|
|
||||||
Arch arch;
|
Arch arch;
|
||||||
arch.init();
|
arch.init();
|
||||||
|
|
||||||
|
|
@ -48,9 +51,6 @@ int main(int argc, char **argv)
|
||||||
// Daemon deliberately does not have a parent, as it will be moved to a new thread.
|
// Daemon deliberately does not have a parent, as it will be moved to a new thread.
|
||||||
DaemonApp daemon(events);
|
DaemonApp daemon(events);
|
||||||
|
|
||||||
QCoreApplication app(argc, argv);
|
|
||||||
QCoreApplication::setApplicationName(QStringLiteral("%1 Daemon").arg(kAppName));
|
|
||||||
|
|
||||||
QCommandLineParser parser;
|
QCommandLineParser parser;
|
||||||
parser.addHelpOption();
|
parser.addHelpOption();
|
||||||
parser.addVersionOption();
|
parser.addVersionOption();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue