From 0915d946c56dddeafda07d778966c1cb92f37cd7 Mon Sep 17 00:00:00 2001 From: Joshua Claveau Date: Sun, 21 Mar 2021 18:36:03 +0100 Subject: [PATCH] Qet start a little more faster (especially on windows) Machine_Info class take time on windows even in powerful computer. Run the machine_info in main.cpp in parallel into another thread. --- sources/main.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/sources/main.cpp b/sources/main.cpp index f69c71089..6d19dc4de 100644 --- a/sources/main.cpp +++ b/sources/main.cpp @@ -22,6 +22,7 @@ #include "utils/macosxopenevent.h" #include +#include /** @brief myMessageOutput @@ -200,16 +201,16 @@ int main(int argc, char **argv) QObject::connect(&app, &SingleApplication::receivedMessage, &qetapp, &QETApp::receiveMessage); - // for debugging - qInstallMessageHandler(myMessageOutput); - qInfo("Start-up"); - // delete old log files of max 7 days old. - delete_old_log_files(7); - { - Machine_info *my_ma =new Machine_info(); - my_ma->send_info_to_debug(); - delete my_ma; - } + QtConcurrent::run([=]() + { + // for debugging + qInstallMessageHandler(myMessageOutput); + qInfo("Start-up"); + // delete old log files of max 7 days old. + delete_old_log_files(7); + auto ma = Machine_info(); + ma.send_info_to_debug(); + }); return app.exec(); }