Files
qelectrotech-source-mirror/sources/qetgraphicsitem
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
..
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-07-27 22:16:52 +02:00
2026-07-27 22:16:52 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-08-01 14:26:39 +02:00
2026-07-27 22:16:52 +02:00
2026-01-16 15:24:35 +01:00
2026-07-27 22:16:52 +02:00
2026-07-27 22:16:52 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-07-31 21:02:07 +02:00
2026-07-31 21:02:07 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00