From 77ca7db46aaad4af3662b21d37e7d50bd3335f34 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 30 Jul 2014 18:21:40 +0200 Subject: [PATCH] Handle early shutdown better --- qutebrowser/app.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/qutebrowser/app.py b/qutebrowser/app.py index c6cd7aa1c..3aad38448 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -675,15 +675,18 @@ class Application(QApplication): self._shutting_down = True log.destroy.debug("Shutting down with status {}...".format(status)) # Save everything - if self.config is not None: + if hasattr(self, 'config') and self.config is not None: to_save = [] if self.config.get('general', 'auto-save-config'): to_save.append(("config", self.config.save)) - to_save += [("command history", self.cmd_history.save), - ("window geometry", self._save_geometry), - ("window geometry", self.stateconfig.save), - ("cookies", self.cookiejar.save), + to_save += [("window geometry", self._save_geometry), ("quickmarks", quickmarks.save)] + if hasattr(self, 'cmd_history'): + to_save.append(("command history", self.cmd_history.save)) + if hasattr(self, 'stateconfig'): + to_save.append(("window geometry", self.stateconfig.save)) + if hasattr(self, 'cookiejar'): + to_save.append(("cookies", self.cookiejar.save)) for what, handler in to_save: log.destroy.debug("Saving {} (handler: {})".format( what, handler.__qualname__))