Make sure to save config on crash

This commit is contained in:
Florian Bruhin 2014-01-31 15:58:14 +01:00
parent 85646af2d0
commit c4edc6f5da
2 changed files with 3 additions and 0 deletions

View File

@ -157,6 +157,7 @@ class QuteBrowser(QApplication):
argv = [sys.executable] + sys.argv + pages
logging.debug('Running {} with args {}'.format(sys.executable,
argv))
config.config.save()
sys.stdout.flush()
# FIXME this seems broken on Windows, execv() splits on whitespace
# in arguments?!?

View File

@ -187,6 +187,8 @@ class Config(ConfigParser):
logging.debug("Saving config to {}".format(self.configfile))
with open(self.configfile, 'w') as f:
self.write(f)
f.flush()
os.fsync(f.fileno())
def dump_userconfig(self):
"""Returns the part of the config which was changed by the user as a