From 1f5ce72fb209419e35a5847a94cd7e002a35e208 Mon Sep 17 00:00:00 2001 From: Dylan Jeannin Date: Wed, 2 Sep 2026 18:00:35 +0200 Subject: [PATCH] Pollutants: fix deletion, didnt work correctly due to relative / flat indexes --- src/View/Pollutants/Table.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/View/Pollutants/Table.py b/src/View/Pollutants/Table.py index df450095..24d4bc5b 100644 --- a/src/View/Pollutants/Table.py +++ b/src/View/Pollutants/Table.py @@ -110,14 +110,10 @@ class TableModel(PamhyrTableModel): def delete(self, rows, parent=QModelIndex()): self.beginRemoveRows(parent, rows[0], rows[-1]) - data_rows = { - id(pol): i for i, pol in enumerate(self._data._Pollutants._lst) - } self._undo.push( DelCommand( self._data._Pollutants, - [data_rows[id(self._lst[row])] for row in rows - if 0 <= row < len(self._lst)], + [row for row in rows if 0 <= row < len(self._lst)], self._data.ic_adists ) )