mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix problem where row numbers in selections are incorrect after a sort
This commit is contained in:
parent
a9c4dbcd21
commit
b32521b6be
@ -235,13 +235,8 @@ class BooksView(QTableView): # {{{
|
|||||||
self.selected_ids = [idc(r) for r in selected_rows]
|
self.selected_ids = [idc(r) for r in selected_rows]
|
||||||
|
|
||||||
def sorting_done(self, indexc):
|
def sorting_done(self, indexc):
|
||||||
if self.selected_ids:
|
self.select_rows(self.selected_ids, using_ids=True, change_current=True,
|
||||||
indices = [self.model().index(indexc(i), 0) for i in
|
scroll=True)
|
||||||
self.selected_ids]
|
|
||||||
sm = self.selectionModel()
|
|
||||||
for idx in indices:
|
|
||||||
sm.select(idx, sm.Select|sm.Rows)
|
|
||||||
self.scroll_to_row(indices[0].row())
|
|
||||||
self.selected_ids = []
|
self.selected_ids = []
|
||||||
|
|
||||||
def sort_by_named_field(self, field, order, reset=True):
|
def sort_by_named_field(self, field, order, reset=True):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user