The version comparison lambda used >= 0, which returns true for
equal versions (compareVersions returns 0 for equal). This violates
strict weak ordering, causing undefined behavior in std::sort.
When the project list is empty (e.g. during project unload or before
any project is opened), Prj() asserted and then dereferenced the
begin iterator of an empty list, causing undefined behavior. Return
a static empty PROJECT instead, matching the defensive pattern used
elsewhere in the settings manager.
Fixes KICAD-105T
Several entry points (macOS file open, file history, project tree) can pass
paths with extensions other than .kicad_pro to the project loading pipeline.
SETTINGS_MANAGER::LoadProject only normalized .pro to .kicad_pro, leaving
other extensions like .kicad_sch or .kicad_pcb to trigger the assertion in
PROJECT::setProjectFullName.
Broaden the extension normalization in SETTINGS_MANAGER::LoadProject to
handle any non-.kicad_pro extension, and replace the assertion in
PROJECT::setProjectFullName with a warning log and forced correction as
defense-in-depth.
Fixes KICAD-NZT
When copying settings from a previous version, the settings sub-directories
may already exist. The settings initial save code would attempt to create
the sub-directory without checking to see if it already existed which would
trigger a wxWidgets directory already exists warning.
Break the most expensive header include chains that contaminate the
largest number of translation units
New lightweight headers for extractdded types:
font_metrics.h, mouse_drag_action.h, board_project_settings_params.h,
common_settings_internals.h, wx_infobar_message_type.h,
zone_layer_properties_grid.h
On Windows, processes hold a handle to their current working directory,
preventing it from being deleted. When LoadProject() sets the CWD to the
project directory, that handle persists even after CloseProject() is
called. This also causes handle inheritance issues when launching external
processes, such as the browser for "Report Bug".
Reset the working directory to the user settings path when unloading an
active project on GUI applications. This mirrors the wxSetWorkingDirectory
call in LoadProject and releases the directory lock.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20577
When starting pcbnew in standalone mode and quickly opening a file, a race
condition could occur where background library loading threads tried to access
Prj() while the project list was being modified. This caused an assertion
failure: "no project in list".
The fix aborts any async library loads before modifying m_projects_list in
SETTINGS_MANAGER::LoadProject() and UnloadProject(). This ensures background
threads have completed before the project list becomes temporarily invalid.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/22697
Get rid of mocking of settings, instead
use actual QA test environment settings
Make sure to load null project at fixture startup
Improve XNODE attribute handling
Fix netlist detection regex for prettified output
Defaults to fully expanded but stores the names for nodes that are
collapsed in project local settings. Because project local settings are
generally changed by modifying views or selection filters, these should
be saved on close rather than only when the project is saved
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19276
Turns out project locks would get created and only stick around for a short duration as the default move constructor was letting the og object free the lock.
But if you crashed kicad or managed something weird, you can get a lock file with no override prompt which also creates confusion as some stuff gets set read only.
So lets just fix this up.
- Implement move constructor on lockfile so that the old object will no longer free the lockfile
- Move lock ownership to the project itself, just slightly less weird to handle for the lock override
- Implement the override lock prompt
Use simplified file extension and name checks rather than a regular
expression to determine which files to archive.
Fix incorrect use of wxFileName which generates invalid paths when the
last folder in the path contains dots.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20431
* Manage the settings using the settings manager for better lifetimes
* Better architect the internals and JSON to make it easier to identify
the various tool types
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo. Avoids needing to
repeatly update.
Also updates AUTHORS.txt from current repo with contributor names
Makes a test backup file and compares to the existing zip file backup to
see if the files have changed since it was made. If so, the new file is
kept. If not, we discard the new file and continue
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12453
The arraystring reference is lost when we don't keep the wxFileName
variable in scope.
This also adds removing invalid paths and checking for correct version
before sorting
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17749