Commit Graph

22 Commits

Author SHA1 Message Date
Shane Ringrose c586a2d3a3 Fix three uninitialised-value bugs found by Valgrind
1. machine_info.h: zero-initialise Screen struct members
   Max_width, Max_height, count, width[] and height[] were bare
   int32_t with no initialiser. The comparisons in
   init_get_Screen_info() read them before any write, producing
   undefined behaviour flagged by Valgrind as 'Conditional jump
   or move depends on uninitialised value(s)'.

2. main.cpp: pre-initialise MachineInfo on the main thread
   MachineInfo::instance() was first called inside QtConcurrent::run(),
   causing its constructor (which calls qApp->screens()) to run on a
   background thread. QScreen methods are not thread-safe in Qt5.
   Calling instance() once on the main thread before the worker
   launches guarantees the singleton is fully built first; subsequent
   calls from the worker just return the cached pointer.

3. qetdiagrameditor.h: move m_first_show before the QActionGroup members
   C++ initialises members in declaration order. m_first_show was
   declared after the QActionGroup members (line 256 vs 168). During
   construction of m_row_column_actions_group(this), Qt dispatches a
   QObject parent-change event that reaches QETDiagramEditor::event(),
   which reads m_first_show before it has been initialised.
   Moving the declaration to the top of the first private: block
   ensures it is initialised before any member that can trigger events.

All three found via Valgrind --tool=memcheck on Ubuntu 22.04 / Qt 5.15.3.
Relates-to: PR #514 (same QtConcurrent thread-safety pattern).
2026-06-20 22:31:06 +12:00
Laurent Trinques 4044d04cc5 One year
Auto-build doxygen docs / doxygen (push) Has been cancelled
Auto-build doxygen docs / deploy (push) Has been cancelled
2026-01-16 15:24:35 +01:00
plc-user 2c5e5c6b78 improve maximum config-dialog-size (no QT5 version-check needed) 2025-12-15 22:28:40 +01:00
Laurent Trinques 77bfe84a4c One year 2025-01-04 13:37:40 +01:00
Laurent Trinques e73cf633ce 2023->2024 2024-03-29 10:09:48 +01:00
Laurent Trinques 9afef79629 Update Copyright date 2023-01-01 17:05:57 +01:00
Laurent Trinques 8af850df44 Add the architecture of the CPU that Qt was compiled for in widget aboutqetdialog and in the logs 2022-07-08 20:50:45 +02:00
Peter Keresztes Schmidt a8d42b0f9a Add MSVC support to MachineInfo 2021-09-22 21:53:21 +02:00
joshua d53bb22509 Make MachineInfo a singleton class
Because on windows MachineInfo take a little time to init, we make it to
a singleton.
MachineInfo is build the first time in main.cpp.
Now all other places where we use MachineInfo (aboutqetdialog and
configdialog) gui don't hang anymore in waiting to MachineInfo finish to
build.
2021-03-22 19:20:07 +01:00
joshua 3d25beaea0 Rename class Machine_info to MachinInfo
Rename to follow the code style of QElectroTech
2021-03-22 19:01:46 +01:00
Joshua Claveau 1b6cf7d5f3 Project properties dialog launch a little more faster (especially on windows)
Instead of build machine_info class which take time, only to get the max
width and height of screens, call  of methods
Machine_info::i_max_screen_width() and
Machine_info::i_max_screen_height() are now static and compute only
this.
The project properties dialog is now faster because don't wait the end
build of machine_info.
2021-03-21 19:01:54 +01:00
joshua 11b8ef927b Revert "Merge branch 'XMLPropertiesNew'"
**Break a lot of thing.**

This reverts commit 1db1800572, reversing
changes made to 4c563821e8.
2021-03-11 19:52:50 +01:00
Martin ea364f9c4e merge 2021-02-23 17:35:55 +01:00
Laurent Trinques ef58f34c14 Update Copyright date 2021-02-20 12:13:46 +01:00
joshua 2513961cd6 Revert "Update Copyright date"
This reverts commit d04bccc384.
2021-02-06 19:00:48 +01:00
Laurent Trinques d04bccc384 Update Copyright date 2021-02-06 18:33:42 +01:00
Simon De Backer dad32d5897 Add destructor to Machine_info class to fix segfault 2020-10-20 08:54:56 +02:00
Simon De Backer d5b7414b36 Mod Machine_info
add send_info_to_debug
Mod get data PC
send to debuger on startup
2020-08-13 22:50:58 +02:00
Simon De Backer d087a8be66 Moved compilation_info to class Machine_info
This is preparation for making a dev log file
2020-07-23 21:57:30 +02:00
Simon De Backer 7420eeb60d Mod name to clarify value is int 2020-07-23 16:49:31 +02:00
Simon De Backer 698db4e5c0 Add Copyright to machine_info class 2020-07-22 21:16:38 +02:00
Simon De Backer 03425bcb5b Add gui resize depending on screen size
Init of request
https://qelectrotech.org/bugtracker/view.php?id=195
This is a start will have to be adjusted further.
2020-07-21 20:29:05 +02:00