From f2b04264458e3831982e2910258d61738be30998 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 26 Dec 2011 13:31:12 +0530 Subject: [PATCH] Do not loose position in book list on device connection/sync, if a search is active. Fixes #908553 (Main window scrolls automatically to top upon completion of task) --- src/calibre/gui2/library/views.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/calibre/gui2/library/views.py b/src/calibre/gui2/library/views.py index 3244a35545..cb73b5ddf0 100644 --- a/src/calibre/gui2/library/views.py +++ b/src/calibre/gui2/library/views.py @@ -51,8 +51,7 @@ class PreserveViewState(object): # {{{ traceback.print_exc() def __exit__(self, *args): - current = self.view.get_selected_ids() - if not current and self.selected_ids: + if self.selected_ids: if self.current_id is not None: self.view.current_id = self.current_id self.view.select_rows(self.selected_ids, using_ids=True,