Avoid running change handlers on config.clear

This commit is contained in:
Florian Bruhin 2018-02-19 05:19:25 +01:00
parent 9c670e13ce
commit 4691753965
2 changed files with 5 additions and 2 deletions

View File

@ -415,8 +415,9 @@ class Config(QObject):
file.
"""
for name, values in self._values.items():
values.clear()
self.changed.emit(name)
cleared = values.clear()
if cleared:
self.changed.emit(name)
if save_yaml:
self._yaml.clear()

View File

@ -92,7 +92,9 @@ class Values:
def clear(self):
"""Clear all customization for this value."""
had_values = bool(self._values)
self._values = []
return had_values
def _get_fallback(self):
"""Get the fallback global/default value."""