14 Commits

Author SHA1 Message Date
jean-pierre charras
c278deb9ef DSNLEXER: do not leave a member ( m_knowsBar ) uninitialized
It can break the footprint file parser and the embedded file parser
2025-06-05 11:36:46 +02:00
Jeff Young
327cca9de5 Coverity fixes. 2025-05-25 20:01:18 +01:00
Seth Hillbrand
e6843cde64 Don't re-read tokens on error
If the data were empty, there is no token, so curTok will represent the
right paren, not the next token

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20301

(cherry picked from commit d2550138bc333ea9538109362c7975ae2da51898)
2025-03-20 13:12:44 -07:00
Seth Hillbrand
a6fbf4bbdb Don't write empty data tags
Also avoid throwing if a data stream is empty so that you can still read
the schematic/pcb/library

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20301
2025-03-11 09:44:58 -07:00
Alex Shvartzkop
3929c3c463 Fix trying to erase m_files end when removing an embedded file. 2025-02-11 00:08:39 +03:00
Seth Hillbrand
919931f0f0 Get embedded files panel working for lib_symbol
The symbol library embedded files were implicit, which made them hard to
work with.  Adding the panel makes it clearer and setting the panel
correctly to the callback ensures that the structure is updated on
close.

Adds some copy/move semantics for EMBEDDED_FILES to take advantage of
how the multiple copies are handled in the library editor

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18935
2025-01-28 12:22:39 -08:00
Seth Hillbrand
0d86b88008 Unify embedded files handling btw editors
Each editor needs the embedded files tab in the
schematic/pcb/symbol/footprint settings.  But the footprint may add an
embedded file from the 3d models tab and symbols/footprints may add
embedded files from the grid.  This should be immediately visible in the
embedded files tab.  Additionally, removing the reference to an embedded
file in the grid or 3d models now removes the embedded file as well.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18934
2025-01-28 12:22:39 -08:00
Wayne Stambaugh
5c8f4697ca Common folder housekeeping part 1. 2025-01-12 12:06:45 -05:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
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
2025-01-01 14:12:04 -08:00
Jeff Young
6686ade45b Remove (somewhat atrophied) manual pretty printing.
Also fixes a bug where the pretty printer didn't insert
linebreaks for a forest (it assumed a single tree root).

Also further regularises bool and quote formatting.
2024-11-28 11:08:16 +00:00
John Beard
436671edc3 Embedded files parser in own header
This drags in dsnlexer.h to everything that uses EMBEDDED_FILES, but the
parser is actually only used in two files. It's not the only thing to
drag it in, though.

Currently, touching dsnlexer.h rebuilds nearly 800 files, when it
actually is needed by about 50 at most.
2024-10-04 15:00:58 +01:00
Seth Hillbrand
5ba50c26a9 Update embedded files hash to use Murmur3
SHA256 is fine for one-offs but for large libraries where we might be
running the hash on hundreds of files, the speed difference is
appreciable.  We don't require crytographic hashing, just a check that
the original file hasn't been corrupted so Murmur3 satisfies our basic
requirement.
2024-09-06 09:57:23 -07:00
Marek Roszko
c16d078b8c Fix conflict with windows header define thats leaking in
GetTempFileName is a windows header define unforunately and the big boi header is leaking in somehow
2024-07-15 20:22:33 -04:00
Seth Hillbrand
77797103f7 Add ability to embed files in various elements
Schematics, symbols, boards and footprints all get the ability to store
files inside their file structures.  File lookups now have a
kicad-embed:// URI to allow various parts of KiCad to refer to files
stored in this manner.

kicad-embed://datasheet.pdf references the file named "datasheet.pdf"
embedded in the document.  Embeds are allowed in schematics, boards,
symbols and footprints.  Currently supported embeddings are Datasheets,
3D Models and drawingsheets

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6918

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2376

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17827
2024-07-15 16:06:55 -07:00