Advanced search dialog: Fix an error when closing dialog if on the second tab and no field is focused

This commit is contained in:
Kovid Goyal 2019-12-15 09:18:14 +05:30
parent 3185b543de
commit ae3208c606
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -272,9 +272,9 @@ class SearchDialog(QDialog):
gprefs['advanced search dialog current tab'] = \ gprefs['advanced search dialog current tab'] = \
self.tab_widget.currentIndex() self.tab_widget.currentIndex()
if self.tab_widget.currentIndex() == 1: if self.tab_widget.currentIndex() == 1:
fw = self.tab_widget.focusWidget().objectName() fw = self.tab_widget.focusWidget()
if fw: if fw:
gprefs.set('advanced_search_simple_tab_focused_field', fw) gprefs.set('advanced_search_simple_tab_focused_field', fw.objectName())
def accept(self): def accept(self):
self.save_state() self.save_state()