Make sure to save config on crash
This commit is contained in:
parent
85646af2d0
commit
c4edc6f5da
@ -157,6 +157,7 @@ class QuteBrowser(QApplication):
|
|||||||
argv = [sys.executable] + sys.argv + pages
|
argv = [sys.executable] + sys.argv + pages
|
||||||
logging.debug('Running {} with args {}'.format(sys.executable,
|
logging.debug('Running {} with args {}'.format(sys.executable,
|
||||||
argv))
|
argv))
|
||||||
|
config.config.save()
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
# FIXME this seems broken on Windows, execv() splits on whitespace
|
# FIXME this seems broken on Windows, execv() splits on whitespace
|
||||||
# in arguments?!?
|
# in arguments?!?
|
||||||
|
@ -187,6 +187,8 @@ class Config(ConfigParser):
|
|||||||
logging.debug("Saving config to {}".format(self.configfile))
|
logging.debug("Saving config to {}".format(self.configfile))
|
||||||
with open(self.configfile, 'w') as f:
|
with open(self.configfile, 'w') as f:
|
||||||
self.write(f)
|
self.write(f)
|
||||||
|
f.flush()
|
||||||
|
os.fsync(f.fileno())
|
||||||
|
|
||||||
def dump_userconfig(self):
|
def dump_userconfig(self):
|
||||||
"""Returns the part of the config which was changed by the user as a
|
"""Returns the part of the config which was changed by the user as a
|
||||||
|
Loading…
Reference in New Issue
Block a user