Fix error when changing libraries with a device connected

This commit is contained in:
Kovid Goyal 2014-08-16 15:05:47 +05:30
parent b829afe225
commit dbf1f184b3

View File

@ -563,10 +563,14 @@ class BooksView(QTableView): # {{{
# Because of a bug in Qt 5 we have to ensure that the header is actually # 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 # relaid out by changing this value, without this sometimes the ghost
# of the ondevice column remains visible when changing libraries # of the ondevice column remains visible when changing libraries
col = self._model.column_map.index('ondevice') try:
val = h.isSectionHidden(col) col = self._model.column_map.index('ondevice')
h.setSectionHidden(col, not val) except ValueError:
h.setSectionHidden(col, val) pass # DeviceBooksView
else:
val = h.isSectionHidden(col)
h.setSectionHidden(col, not val)
h.setSectionHidden(col, val)
def get_default_state(self): def get_default_state(self):
old_state = { old_state = {