For unique_ptr, release only set the ownership to null, but don't free the resource behind. On the other hand, reset do.
Closes Coverity ID 483269
Closes Coverity ID 471974
Closes Coverity ID 471973
The IO_RELEASER is a thin-wrapper around a std::unique_ptr, but done
this way to allow easier addition of a custom deleter in the future if
something needs to call back into the IO_MGR.
This adds Reset() method to KIFACE to reload global libs stored in
global static vars.
Also refactors some lib reload code in various frames to have
common MAIL_RELOAD_LIB handler.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12500
Versions specific variables that may point to objects that change
through versions, allowing multiple KiCad versions to operate correctly
(even on MSW) on the same machine.
CHANGED: Settings are now stored in versioned sub-directories
ADDED: First-run dialog for migrating settings from a previous version
CHANGED: Settings are now stored as JSON files instead of wxConfig-style INI files
CHANGED: Color settings are now all stored in a separate settings file
CHANGED: The symbol editor and footprint editor now have their own settings files
CHANGED: Color settings are no longer exposed through BOARD object
CHANGED: Page layout editor now uses Eeschema's color scheme
Settings are now managed through a central SETTINGS_MANAGER held by PGM_BASE.
Existing settings will be migrated from the wxConfig format on first run of each application.
Per-application settings are now stored in one class for each application.
When no default library tables are found, set the default wxFilePickerCtrl
to the users configuration path instead of the current project path to
prevent any project library tables from being used as the default.
Fixes lp:1809769
https://bugs.launchpad.net/kicad/+bug/1809769
Adds Cut/Copy/Paste and Revert for footprints; introduces a new
shared Revert Changes? dialog; hooks up Add Library for footprints,
standardizes the Save As terminology.
While we already cache the loaded footprint files, parsing said files
into the list is also time-intensive. Since the FOOTPRINT_LIST is
already hash-stamped against the current timestamps of the files that
make up the list, sharing a single copy of the list is quite
straight-forward.
It's too expensive to fetch the timestamps when the github
server is busy. See Dick Hollenbeck's comments at the top of
github_plugin.cpp for more info.
Also adds some safety to the other caching algorithms after
seeing github_plugin's wild-west usage of the kicad_plugin.
Fixes: lp:1753143
* https://bugs.launchpad.net/kicad/+bug/1753143
Too many external applications fail to touch the parent directory.
Also removes FP_CACHE_ITEM lastMod times and dirty flags as we've
always loaded libraries atomically anyway.
Claws back some of the performance lost by being more efficient
with cache management for sequential calls to Enumerate and then
Load.
Fixes: lp:1750936
* https://bugs.launchpad.net/kicad/+bug/1750936
Smartens the cache freshness checking, and adds checksums of
constituent-directory last-mod-dates to the footprint info
list.
Also inserts the dataPtrs into the list at the same time as
the text to keep wxWidgets from measuring the width of the
text twice (yes, really). And converts the list to default-
column widths in case the wxWidgets patch is present to
greatly speed list creation (by not measuring all that text).
On my machine drops the first-load time from 4s to 2.5s and
the subsequent-load times from 2.5s to < 1s. With the
wxWidgets patch subsequent-loads become near-instantaneous.
- Also makes the project and file import functions filetype dependent.
- The change from IO_MGR::KICAD to IO_MGR::KICAD_SEXP removes a conflict from a compile definition for KICAD when compiling kicad/import_project.cpp
This forces the compiler class specific features rather than borrowing
from the base class's std::string. In some cases prior to this,
wxString( std::string ) was being called rather than UTF8::operator
wxString() leading to garbled wxStrings.
Added function UTF8::wx_str() which is of great convenience also.
Implicit conversions still work as before, and hopefully more reliably.
This commit was too broad and not cognizant of the purpose of the class
UTF8.
Add MAYBE_VERIFY_UTF8() macro, which can trap non-UTF8 encoded strings in
debug builds.
Use that macro conditionally in class UTF8 to trap non-UTF8 encoded strings
being put into UTF8 instances.
Fix potential memory leak in both footprint and symbol library table
parsers when a duplicate library nickname entry exists.
Parse entire symbol library table before raising duplicate nickname
exception.
Improve the duplicate library table nickname error message to make
life easier for users to fix broken tables.