mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-02 16:44:16 +02:00
9bfe18807f
Two additional bugs found after the initial xref cleanup: 1. Undo after unlink did not restore PLC variables (PLC_TYPE, PLC_ADDRESS, etc.) because PlcLinkWidget::on_m_unlink_pb_clicked() never stored the current group index in the LinkElementCommand. makeLink() only populates PLC fields when group_idx >= 0, so the slave was re-linked but appeared empty. Fixed by reading the group index from the master via groupIndexForElement() and calling setGroupIndex() before unlinking. 2. m_update_slave_Xref_connection was only cleared inside the if(m_slave_Xref_item) block in the updateXref() cleanup path. For AlignHCenter (Text field) position, no m_slave_Xref_item is ever created — the connections are stored in m_update_slave_Xref_connection but never cleaned up on unlink. On re-link, the old stale entries prevented new connections from being established. Fixed by clearing the list unconditionally in the cleanup path.