# # # patch "src/model/Inventory.cpp" # from [6a56acc619ca6a4df8d306edeea60f89f9a46094] # to [63a2f7d906ea4aaaccb8f64c63425efe50ca488e] # ============================================================ --- src/model/Inventory.cpp 6a56acc619ca6a4df8d306edeea60f89f9a46094 +++ src/model/Inventory.cpp 63a2f7d906ea4aaaccb8f64c63425efe50ca488e @@ -331,6 +331,9 @@ void Inventory::insertRowsRecursive(Mode const QList & children = parentChildRelations.value(parentItem); I(children.size() > 0); + // + // remove existing new nodes, just to ensure we don't add duplicates + // foreach (ModelItem * item, children) { InventoryItem * invitem = qobject_cast(item); @@ -345,9 +348,10 @@ void Inventory::insertRowsRecursive(Mode removeRowsRecursive(oldParent, row, row); } } + // - // ensure that all old rows get deleted at first (and ensure that each - // item is only processed once...) + // now additionally remove all those nodes which are no longer part of + // the tree, but still attached to the old parent item // InventoryItem * newInventoryParent = qobject_cast(parentItem); if (newInventoryParent)