From 7fa242a55fd4a2934672d59cfcf9c50593414e98 Mon Sep 17 00:00:00 2001 From: DaTweety <129504390+DaTweety@users.noreply.github.com> Date: Sun, 18 Oct 2026 22:46:25 +0200 Subject: [PATCH] Keep a potential's wire number for a new wire drawn from a cable core inheritedProperties() cleared the text of a conductor held by a cable, on the premise that CableManager writes the core label into it. It writes it into m_cable only (Conductor::setCableReference()); the text is the potential's real wire number. Clearing it lost a typed number on the new wire and made distinctProperties() see a choice between "" and the number where the potentials agreed. The text is now cleared only when it repeats the core label. Co-Authored-By: Claude Opus 5.5 --- sources/utils/conductorcreator.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sources/utils/conductorcreator.cpp b/sources/utils/conductorcreator.cpp index fdfd593b2..6bfe717a7 100644 --- a/sources/utils/conductorcreator.cpp +++ b/sources/utils/conductorcreator.cpp @@ -134,10 +134,10 @@ bool ConductorCreator::needsPotentialChoice(const QList &terminals_l /** @brief ConductorCreator::inheritedProperties The properties a new wire takes from @p conductor's potential. A - cable's core names the cable and the core in m_cable, m_cable_uuid, - m_cable_slot and, written by CableManager, in its text (15W1:BN): none - of that belongs to a new wire, which is in no cable yet. The text is - then left to the formula. + cable's core names the cable and the core in m_cable, m_cable_uuid + and m_cable_slot (written by CableManager): none of that belongs to a + new wire, which is in no cable yet. The text is the potential's wire + number and is kept, unless it only repeats the core label. @param conductor : a conductor of the potential @return the properties for a new conductor of that potential */ @@ -146,10 +146,11 @@ ConductorProperties ConductorCreator::inheritedProperties(const Conductor *condu ConductorProperties properties = conductor->properties(); if (!properties.m_cable_uuid.isNull()) { + if (properties.text == properties.m_cable) + properties.text.clear(); properties.m_cable.clear(); properties.m_cable_uuid = QUuid(); properties.m_cable_slot = -1; - properties.text.clear(); } return properties; }