Kinder in Knoten umbenannt

This commit is contained in:
2025-08-14 20:37:03 +02:00
parent db230494a2
commit 203edf3ad1
+7 -7
View File
@@ -700,7 +700,7 @@ class MainWindow(QMainWindow):
if node.id == target_id: if node.id == target_id:
return node return node
# Rekursiv in Kindern suchen (nur bei TreeNode) # Rekursiv in Knotenn suchen (nur bei TreeNode)
if isinstance(node, TreeNode) and node.children: if isinstance(node, TreeNode) and node.children:
found = self._find_node_by_id(node.children, target_id) found = self._find_node_by_id(node.children, target_id)
if found: if found:
@@ -1020,14 +1020,14 @@ class MainWindow(QMainWindow):
# Setze zusätzliche Informationen in Spalte 1 # Setze zusätzliche Informationen in Spalte 1
if isinstance(node, TreeNode): if isinstance(node, TreeNode):
# TreeNode: Zeige Anzahl der Kinder # TreeNode: Zeige Anzahl der Knoten
child_count = len(node.children) if node.children else 0 child_count = len(node.children) if node.children else 0
item.setText(1, f"({child_count} Kinder)") item.setText(1, f"{child_count} Knoten")
# Speichere zusätzlich die Node-ID in UserRole+1 für Kompatibilität # Speichere zusätzlich die Node-ID in UserRole+1 für Kompatibilität
item.setData(0, Qt.ItemDataRole.UserRole + 1, node.id) item.setData(0, Qt.ItemDataRole.UserRole + 1, node.id)
# Lade Kinder rekursiv # Lade Knoten rekursiv
if node.children: if node.children:
for child in node.children: for child in node.children:
child_item = self._create_tree_item_from_node(child) child_item = self._create_tree_item_from_node(child)
@@ -1040,7 +1040,7 @@ class MainWindow(QMainWindow):
# Speichere zusätzlich die Node-ID in UserRole+1 für Kompatibilität # Speichere zusätzlich die Node-ID in UserRole+1 für Kompatibilität
item.setData(0, Qt.ItemDataRole.UserRole + 1, node.id) item.setData(0, Qt.ItemDataRole.UserRole + 1, node.id)
# Lade XML-Dateien als Kinder # Lade XML-Dateien als Knoten
if node.xmls: if node.xmls:
for xml in node.xmls: for xml in node.xmls:
xml_item = QTreeWidgetItem() xml_item = QTreeWidgetItem()
@@ -1533,11 +1533,11 @@ class MainWindow(QMainWindow):
print(f"Aktualisiere XSL-Datei für Node {existing_node.id}: '{existing_node.xsl_file}' -> '{new_node.xsl_file}'") print(f"Aktualisiere XSL-Datei für Node {existing_node.id}: '{existing_node.xsl_file}' -> '{new_node.xsl_file}'")
existing_node.xsl_file = new_node.xsl_file existing_node.xsl_file = new_node.xsl_file
# Rekursiv für Kinder (nur bei TreeNode) # Rekursiv für Knoten (nur bei TreeNode)
if isinstance(existing_node, TreeNode) and existing_node.children: if isinstance(existing_node, TreeNode) and existing_node.children:
self._merge_nodes_recursive(existing_node.children, new_nodes_dict) self._merge_nodes_recursive(existing_node.children, new_nodes_dict)
# Füge neue Kinder hinzu, die noch nicht existieren # Füge neue Knoten hinzu, die noch nicht existieren
if existing_node.id in new_nodes_dict: if existing_node.id in new_nodes_dict:
new_node = new_nodes_dict[existing_node.id] new_node = new_nodes_dict[existing_node.id]
if isinstance(new_node, TreeNode) and new_node.children: if isinstance(new_node, TreeNode) and new_node.children: