From bcc5055ef34900c4d8b32b251a8a28fdde586d74 Mon Sep 17 00:00:00 2001 From: Sally Date: Thu, 21 Mar 2019 12:37:09 +0100 Subject: [PATCH] [bugfix] Sorting items before removing them from list The selectedIndexes are now sorted before the are removed from the listView. Otherwise you get problems with indices that aren't in descending order. --- pylot/core/util/widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index 1d0b1844..d828b8cb 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -308,7 +308,7 @@ class AddMetadataWidget(QWidget): also adds the path to the list of inventories that get deleted upon accepting all changes or deletes the path from the list of of inventories that get added to the metadata upon accepting all changes """ - for index in reversed(self.list_view.selectionModel().selectedIndexes()): + for index in reversed(sorted(self.list_view.selectionModel().selectedIndexes())): item = self.list_model.itemData(index) inventory_path = item[0] # marked path self.list_model.removeRow(index.row()) # aus der Anzeige-Liste gelöscht