From 73c319a1ec83412806cd73cb5aeaa1554a631b35 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 15 Apr 2014 17:28:05 +0200 Subject: [PATCH] Add autosave option --- qutebrowser/app.py | 9 +++++---- qutebrowser/config/configdata.py | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/qutebrowser/app.py b/qutebrowser/app.py index 1e398ffb0..beedd31b9 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -374,10 +374,11 @@ class QuteBrowser(QApplication): return self._shutting_down = True logging.debug("Shutting down... (do_quit={})".format(do_quit)) - try: - config.config.save() - except AttributeError: - logging.exception("Could not save config.") + if config.config.get('general', 'autosave'): + try: + config.config.save() + except AttributeError: + logging.exception("Could not save config.") try: self._save_geometry() config.state.save() diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index b316edb03..ac9f3106c 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -134,6 +134,10 @@ def configdata(): ('defaultzoom', SettingValue(types.ZoomPerc, "100%"), "The default zoom level."), + + ('autosave', + SettingValue(types.Bool, "true"), + "Whether to save the config automatically on quit."), )), ('tabbar', sect.KeyValue(