Remove only initially selected rows in CSV export/import

The selection is changed after each removal and select new rows which result in
removing all the rows.
Indeed the TreeIter should be computed before modifying the store to ensure to
always remove the right rows.

issue6413
review37311002
This commit is contained in:
Cédric Krier committed 2017-04-10 23:20:58 +02:00
1 parent 7409e024fa
commit af6b1412bc
2 files changed
+8 -6

No files matched your search

+4 -3
View File
@@ -148,9 +148,10 @@ class WinExport(WinCSV):
def sig_unsel(self, *args):
store, paths = self.view2.get_selection().get_selected_rows()
while paths:
store.remove(store.get_iter(paths[0]))
store, paths = self.view2.get_selection().get_selected_rows()
# Convert first into TreeIter before removing from the store
iters = [store.get_iter(p) for p in paths]
for i in iters:
store.remove(i)
def sig_unsel_all(self, *args):
self.model2.clear()
+4 -3
View File
@@ -157,9 +157,10 @@ class WinImport(WinCSV):
def sig_unsel(self, *args):
store, paths = self.view2.get_selection().get_selected_rows()
while paths:
store.remove(store.get_iter(paths[0]))
store, paths = self.view2.get_selection().get_selected_rows()
# Convert first into TreeIter before removing from the store
iters = [store.get_iter(p) for p in paths]
for i in iters:
store.remove(i)
def sig_unsel_all(self, *args):
self.model2.clear()