# # # patch "src/model/Inventory.cpp" # from [792f0527f9627c2fc2b68d5ebc28b0b846ae6db4] # to [6a56acc619ca6a4df8d306edeea60f89f9a46094] # ============================================================ --- src/model/Inventory.cpp 792f0527f9627c2fc2b68d5ebc28b0b846ae6db4 +++ src/model/Inventory.cpp 6a56acc619ca6a4df8d306edeea60f89f9a46094 @@ -331,6 +331,20 @@ void Inventory::insertRowsRecursive(Mode const QList & children = parentChildRelations.value(parentItem); I(children.size() > 0); + foreach (ModelItem * item, children) + { + InventoryItem * invitem = qobject_cast(item); + if (!invitem) continue; + + QString path = invitem->getPath(); + if (itemMap.contains(path)) + { + InventoryItem * oldItem = itemMap.value(path); + ModelItem * oldParent = oldItem->parent(); + int row = oldItem->row(); + removeRowsRecursive(oldParent, row, row); + } + } // // ensure that all old rows get deleted at first (and ensure that each // item is only processed once...)