Fix a regression that could cause window layout settings to sometimes not be saved during shutdown

This commit is contained in:
Kovid Goyal 2019-11-27 09:13:15 +05:30
parent 8cf8421385
commit fdc0c7cf7e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 8 deletions

View File

@ -345,9 +345,5 @@ class InterfaceAction(QObject):
Called once per plugin when the main GUI is in the process of shutting Called once per plugin when the main GUI is in the process of shutting
down. Release any used resources, but try not to block the shutdown for down. Release any used resources, but try not to block the shutdown for
long periods of time. long periods of time.
:return: False to halt the shutdown. You are responsible for telling
the user why the shutdown was halted.
''' '''
return True pass

View File

@ -930,7 +930,8 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
try: try:
self.shutdown() self.shutdown()
except: except:
pass import traceback
traceback.print_exc()
self.restart_after_quit = restart self.restart_after_quit = restart
self.debug_on_restart = debug_on_restart self.debug_on_restart = debug_on_restart
if self.system_tray_icon is not None and self.restart_after_quit: if self.system_tray_icon is not None and self.restart_after_quit:
@ -994,8 +995,7 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
db.commit_dirty_cache() db.commit_dirty_cache()
db.prefs.write_serialized(prefs['library_path']) db.prefs.write_serialized(prefs['library_path'])
for action in self.iactions.values(): for action in self.iactions.values():
if not action.shutting_down(): action.shutting_down()
return
if write_settings: if write_settings:
self.write_settings() self.write_settings()
self.check_messages_timer.stop() self.check_messages_timer.stop()