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 @@ def scroll_to_row(self, row):
break
def set_current_row(self, row, select=True):
if row > -1:
if row > -1 and row < self.model().rowCount(QModelIndex()):
h = self.horizontalHeader()
logical_indices = list(range(h.count()))
logical_indices = [x for x in logical_indices if not

View file

@ -522,6 +522,7 @@ def library_moved(self, newloc, copy_structure=False, call_close=True):
self.card_a_view.reset()
self.card_b_view.reset()
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
# interface later
gc.collect()