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.
This commit is contained in:
Joshua Claveau
2021-03-21 18:36:03 +01:00
parent 8fdb9ba21a
commit 6cf79e6e75

View File

@@ -22,6 +22,7 @@
#include "utils/macosxopenevent.h" #include "utils/macosxopenevent.h"
#include <QStyleFactory> #include <QStyleFactory>
#include <QtConcurrent>
/** /**
@brief myMessageOutput @brief myMessageOutput
@@ -200,16 +201,16 @@ int main(int argc, char **argv)
QObject::connect(&app, &SingleApplication::receivedMessage, QObject::connect(&app, &SingleApplication::receivedMessage,
&qetapp, &QETApp::receiveMessage); &qetapp, &QETApp::receiveMessage);
// for debugging QtConcurrent::run([=]()
qInstallMessageHandler(myMessageOutput); {
qInfo("Start-up"); // for debugging
// delete old log files of max 7 days old. qInstallMessageHandler(myMessageOutput);
delete_old_log_files(7); qInfo("Start-up");
{ // delete old log files of max 7 days old.
Machine_info *my_ma =new Machine_info(); delete_old_log_files(7);
my_ma->send_info_to_debug(); auto ma = Machine_info();
delete my_ma; ma.send_info_to_debug();
} });
return app.exec(); return app.exec();
} }