mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 06:20:53 +01:00
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:
@@ -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);
|
||||||
|
|
||||||
|
QtConcurrent::run([=]()
|
||||||
|
{
|
||||||
// for debugging
|
// for debugging
|
||||||
qInstallMessageHandler(myMessageOutput);
|
qInstallMessageHandler(myMessageOutput);
|
||||||
qInfo("Start-up");
|
qInfo("Start-up");
|
||||||
// delete old log files of max 7 days old.
|
// delete old log files of max 7 days old.
|
||||||
delete_old_log_files(7);
|
delete_old_log_files(7);
|
||||||
{
|
auto ma = Machine_info();
|
||||||
Machine_info *my_ma =new Machine_info();
|
ma.send_info_to_debug();
|
||||||
my_ma->send_info_to_debug();
|
});
|
||||||
delete my_ma;
|
|
||||||
}
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user