Allow deletion of a key from settings that is no longer in defaults

This commit is contained in:
Gina Häußge 2015-07-21 17:52:49 +02:00
parent 1cdd61fcbf
commit b04da70ce6

View file

@ -975,7 +975,7 @@ class Settings(object):
if not force and key in defaults and key in config and defaults[key] == value: if not force and key in defaults and key in config and defaults[key] == value:
del config[key] del config[key]
self._dirty = True self._dirty = True
elif force or (not key in config and defaults[key] != value) or (key in config and config[key] != value): elif force or (not key in config and key in defaults and defaults[key] != value) or (key in config and config[key] != value):
if value is None and key in config: if value is None and key in config:
del config[key] del config[key]
else: else: