Fix condition for saving node name alias
I noticed that the node labels were not being updated when the media.name
property changed, but their tooltips were:
I then found out that the node names were being persisted in the config file as aliases, which led me to find that the condition portNameLabel() != portTitle()
(which is used to determine if the label should be saved) was true for all nodes (including not renamed ones).
nodeTitle()
should be compared to nodeNameLabel()
, not nodeName()
(the same way it is in https://gitlab.freedesktop.org/rncbc/qpwgraph/-/blob/main/src/qpwgraph_canvas.cpp#L1323)
as m_title
is assigned to name_label
in https://gitlab.freedesktop.org/rncbc/qpwgraph/-/blob/main/src/qpwgraph_node.cpp#L196 (if title.isEmpty()
)
portTitle()
should be compared to portName()
, not portNameLabel()
(the same way it is in https://gitlab.freedesktop.org/rncbc/qpwgraph/-/blob/main/src/qpwgraph_canvas.cpp#L1445)
as m_title
is assigned to m_name
in https://gitlab.freedesktop.org/rncbc/qpwgraph/-/blob/main/src/qpwgraph_port.cpp#L173 (if title.isEmpty()
)
After fixing this, users should clear the GraphNodeAliases
entry in the config file $XDG_CONFIG_HOME/rncbc.org/qpwgraph.conf
, as it's going to contain entries for all the nodes ever created.