From a2ae8255aca9759df407e2db637522b0e5d230ba Mon Sep 17 00:00:00 2001 From: joshua Date: Tue, 1 Jul 2025 22:46:18 +0200 Subject: [PATCH] Minor fix During the development, we saved some terminal strip with "phantom" terminal (terminal added to the strip and after the terminal was removed from the project but keep in the terminal strip data) and this mistake was saved in the xml. When we open this project the phantom terminal don't appear in the layout but the empty physical terminal is still here in the terminal strip data because the position of the terminals in the strip is wrong (sometime bigger than the size of the strip, sometime with a gap, sometime don't start at 0). This commit fix this mistake when we open a project. --- sources/TerminalStrip/terminalstrip.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sources/TerminalStrip/terminalstrip.cpp b/sources/TerminalStrip/terminalstrip.cpp index 839a5493e..8d469cc3b 100644 --- a/sources/TerminalStrip/terminalstrip.cpp +++ b/sources/TerminalStrip/terminalstrip.cpp @@ -1037,8 +1037,10 @@ bool TerminalStrip::fromXml(QDomElement &xml_element) } } - auto raw_ptr = new PhysicalTerminal(this, real_t_vector); - m_physical_terminals.append(raw_ptr->sharedRef()); + if (!real_t_vector.isEmpty()) { + auto raw_ptr = new PhysicalTerminal(this, real_t_vector); + m_physical_terminals.append(raw_ptr->sharedRef()); + } } }