This commit is contained in:
Kovid Goyal 2011-08-10 13:40:34 -06:00
parent 226f444274
commit b150851a58
2 changed files with 2 additions and 1 deletions

View File

@ -719,7 +719,7 @@ class BooksView(QTableView): # {{{
break break
def set_current_row(self, row, select=True): def set_current_row(self, row, select=True):
if row > -1: if row > -1 and row < self.model().rowCount(QModelIndex()):
h = self.horizontalHeader() h = self.horizontalHeader()
logical_indices = list(range(h.count())) logical_indices = list(range(h.count()))
logical_indices = [x for x in logical_indices if not logical_indices = [x for x in logical_indices if not

View File

@ -522,6 +522,7 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
self.card_a_view.reset() self.card_a_view.reset()
self.card_b_view.reset() self.card_b_view.reset()
self.device_manager.set_current_library_uuid(db.library_id) self.device_manager.set_current_library_uuid(db.library_id)
self.library_view.set_current_row(0)
# Run a garbage collection now so that it does not freeze the # Run a garbage collection now so that it does not freeze the
# interface later # interface later
gc.collect() gc.collect()