Skip to content

Commit

Permalink
Fix error when changing libraries with a device connected
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Aug 16, 2014
1 parent b829afe commit dbf1f18
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/calibre/gui2/library/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,10 +563,14 @@ def apply_state(self, state, max_sort_levels=3):
# Because of a bug in Qt 5 we have to ensure that the header is actually
# relaid out by changing this value, without this sometimes the ghost
# of the ondevice column remains visible when changing libraries
col = self._model.column_map.index('ondevice')
val = h.isSectionHidden(col)
h.setSectionHidden(col, not val)
h.setSectionHidden(col, val)
try:
col = self._model.column_map.index('ondevice')
except ValueError:
pass # DeviceBooksView
else:
val = h.isSectionHidden(col)
h.setSectionHidden(col, not val)
h.setSectionHidden(col, val)

def get_default_state(self):
old_state = {
Expand Down

0 comments on commit dbf1f18

Please sign in to comment.