Commit Graph

173 Commits

Author SHA1 Message Date
ispyisail 0fdcd1e1e8 Regenerate conductor uuids when a folio is duplicated
ElementsPanelWidget::duplicateDiagram() round-trips the folio through XML
and then gives the copied *elements* fresh uuids, because element.uuid is
the primary key of the project database and a duplicate silently fails to
insert. Conductors now have the same problem and needed the same loop:
conductor.uuid is likewise a primary key, its insert is a plain INSERT
rather than INSERT OR IGNORE, and a failure only reaches qDebug(). Without
this, every wire on a duplicated folio is missing from the wiring list and
from the per-element wire count, with nothing shown to the user.

Verified against the real schema: inserting the same conductor uuid for a
second folio fails with "UNIQUE constraint failed: conductor.uuid", leaving
one row where two were expected.

Also harden the uuid read in Conductor::fromXml(). The default argument of
QDomElement::attribute() is evaluated whether or not the attribute exists,
so a uuid was minted for every conductor on every load and thrown away; and
the default only applies when the attribute is *absent*, so a present but
empty or malformed uuid="" parsed to a null QUuid rather than a fresh one --
and null uuids collide with each other exactly as duplicates do.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 19:07:40 +12:00
ispyisail a3511e8694 Give Conductor its own persisted uuid
Slice 1 of discussion #503 (from-to wiring list built on projectDataBase).

Conductor is the one item type on a diagram without a stable identity
of its own -- Element and Diagram both have a uuid, Conductor didn't.
This is the prerequisite the wiring-list tables need: a conductor
table keyed by uuid, the same way the existing element table is keyed
by Element::uuid().

- Conductor gets a QUuid m_uuid, generated in the constructor, with
  uuid()/newUuid() accessors mirroring Element's exact pattern.
- toXml()/fromXml() read/write a "uuid" attribute the same way
  Element already does, including the same generate-on-missing
  fallback (QUuid(e.attribute("uuid", QUuid::createUuid().toString())))
  for projects saved before this change.
- PasteDiagramCommand::redo() calls newUuid() on every pasted
  conductor (content.conductors(), all three categories), mirroring
  the existing per-element newUuid() call right above it -- otherwise
  copy-paste would duplicate a conductor's uuid.

Backward compatibility: Conductor::valideXml() doesn't require the
"uuid" attribute, so old files parse unchanged. Verified by opening a
genuinely pre-uuid project (examples/industrial.qet, 150 folios, 671
conductors, legacy integer terminal1/terminal2 references with no
uuid attribute at all) -- loads and renders correctly, gets uuids
assigned on load, and those uuids are stable across a second
load/save cycle (byte-identical uuid values). Verified paste
separately: copying a selection with conductors and pasting produces
distinct new uuids for every pasted conductor, none colliding with
the originals or each other.
2026-08-02 08:12:22 +12:00
Kellermorph 4e0c075575 Fix grid and guide startup behavior and update german translation 2026-06-16 17:41:03 +02: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 410c9293d1 adjust variable-names and comments; minor change in length-compare of conductor-segments 2025-10-19 15:48:03 +02:00
plc-user 07c34d7358 add and correct English comments 2025-10-19 15:37:07 +02:00
plc-user 0f179a5d49 add and correct English comments 2025-08-09 09:05:34 +02:00
plc-user 757df90951 minor: added some English comments 2025-03-13 21:05:21 +01:00
plc-user 0084dcf289 fix typo with function-name 2025-03-07 20:53:07 +01:00
plc-user 27cff81ee7 adjust zoom-factor to use cosmetic-line and fixed comments 2025-03-07 10:58:47 +01:00
plc-user 6c52d95201 same simplifications as in #376 "use the same code for Qt5 & Qt6" 2025-03-03 22:41:44 +01:00
plc-user e987d8c271 fix typo in variable-name 2025-02-28 20:25:31 +01:00
Magnus Hellströmer 68a2ddde18 New variables for conductor text formulas 2025-02-19 20:26:53 +01:00
plc-user 3471140b64 fix typo in fuction-name (looked like a mixture of French and English) 2025-02-14 16:47:39 +01:00
Laurent Trinques 43f0107eb1 Revert "Try Clazy fix-its"
Segfault on old Qt versions!
This reverts commit dba7caed30.
2025-02-14 16:17:58 +01:00
Laurent Trinques dba7caed30 Try Clazy fix-its
clazy is a compiler plugin which allows clang to understand Qt
semantics. You get more than 50 Qt related compiler warnings, ranging
from unneeded memory allocations to misusage of API, including fix-its
for automatic refactoring.

https://invent.kde.org/sdk/clazy
2025-02-14 15:52:23 +01:00
plc-user 516eb9eb45 fixed English comments 2025-02-12 14:02:30 +01:00
Laurent Trinques 77bfe84a4c One year 2025-01-04 13:37:40 +01:00
plc-user 1062d217f0 move code into else-clause to avoid possible crashes 2024-07-15 00:01:20 +02:00
Laurent Trinques cbd309ec5a
Fix :
Add element1_linked element2_linked informations to terminal-name
connected in qet-file
2024-06-30 15:02:42 +02:00
Laurent Trinques 23c4ba2a3e Fix segfault in previous commit 2024-06-21 17:48:57 +02:00
Laurent Trinques dd03f0eece Add elements informations to terminal-name connected in qet-file 2024-06-21 15:28:57 +02:00
plc-user f9073ca5fb add terminal-names to connection in qet-file 2024-06-16 15:53:09 +02:00
plc-user fa68d545d0 correct more indentations / whitespace 2024-04-24 14:14:40 +02:00
Laurent Trinques e73cf633ce 2023->2024 2024-03-29 10:09:48 +01:00
Laurent Trinques 902a976cc3 Change weighting of second conductor color
See: https://qelectrotech.org/bugtracker/view.php?id=292
On old project you replace in text editor
dash-size="10" by dash-size="5"
2023-11-05 16:09:48 +01:00
joshua 247b98da41 Fix minor bug : conductor text is not updated when folio id is used
See https://qelectrotech.org/forum/viewtopic.php?pid=18157#p18157
2023-04-17 22:09:18 +02:00
joshua ec5cda10db Minor : improve first and last segment position of conducteur 2023-01-31 23:13:05 +01:00
Laurent Trinques 9afef79629 Update Copyright date 2023-01-01 17:05:57 +01:00
luz paz 1994235bc5 Fix various typos in source documentation and comments (cont.)
Found via `codespell`
2022-12-04 20:46:32 +01:00
joshua ae9faa2192 Add toolbar widget for edit size of handler in diagram editor.
Add a combo box in the tool bar of diagram editor
to quickly change the size of the graphics handler item.

The sarto commit :D

NOTE
only available for diagram editor, element editor will
come later.
2022-01-03 21:01:25 +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
joshua 1db1800572 Merge branch 'XMLPropertiesNew' 2021-03-09 19:09:31 +01:00
Martin Marmsoler 755bcf640d fix conductor properties xml load 2021-03-07 14:07:47 +01:00
Martin Marmsoler 5d3710c4b2 copy all toXML() from master commit 4b82c3a0c4 into the current branch, because the new concept will be used only for user properties 2021-03-07 10:09:45 +01:00
Martin Marmsoler 058824f29a move all static xml functions to qetxml 2021-03-06 20:01:31 +01:00
joshua 4b82c3a0c4 Fix crash
Fix crash for a special case (the first time since qet exist) when a
conductor have all segments to 0 in the .qet file.
See https://qelectrotech.org/forum/viewtopic.php?id=1964
2021-03-06 15:17:10 +01:00
Martin Marmsoler 9d4b90da1a Add userProperties 2021-03-04 19:18:28 +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 c13af5ace0 Clean some include 2021-02-07 20:44:17 +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 6da9c58458 Wip Fix preprocessor on Cmake 2020-12-10 21:19:45 +01:00
Simon De Backer d0c129478e Mod Cmake en preprocessor 2020-12-10 00:08:26 +01:00
Simon De Backer 10c4c3d528 Wip Fix preprocessor on Cmake 2020-12-08 19:57:35 +01:00
Martin Marmsoler 9658a88c18 fix compile issues 2020-10-20 08:54:56 +02:00
Martin Marmsoler 12e301b887 replace 4 spaces by a tab 2020-10-20 08:54:56 +02:00
Martin Marmsoler f3097fc537 rebase XMLProperties_New (c0d9bf9) to master 2020-10-20 08:54:14 +02:00
Martin Marmsoler 73b394527d replace tabs by 4 spaces 2020-10-20 08:53:43 +02:00