Make clearing config work
This commit is contained in:
parent
a6b979539d
commit
9c670e13ce
@ -414,10 +414,8 @@ class Config(QObject):
|
||||
If save_yaml=True is given, also remove all customization from the YAML
|
||||
file.
|
||||
"""
|
||||
# FIXME:conf support per-URL settings?
|
||||
old_values = self._values
|
||||
self._values = {}
|
||||
for name in old_values:
|
||||
for name, values in self._values.items():
|
||||
values.clear()
|
||||
self.changed.emit(name)
|
||||
|
||||
if save_yaml:
|
||||
|
@ -239,8 +239,8 @@ class YamlConfig(QObject):
|
||||
|
||||
def clear(self):
|
||||
"""Clear all values from the YAML file."""
|
||||
# FIXME:conf per-URL support?
|
||||
self._values = []
|
||||
for values in self._values.values():
|
||||
values.clear()
|
||||
self._mark_changed()
|
||||
|
||||
|
||||
|
@ -90,6 +90,10 @@ class Values:
|
||||
# FIXME:conf Should this ignore patterns which weren't found?
|
||||
self._values = [v for v in self._values if v.pattern != pattern]
|
||||
|
||||
def clear(self):
|
||||
"""Clear all customization for this value."""
|
||||
self._values = []
|
||||
|
||||
def _get_fallback(self):
|
||||
"""Get the fallback global/default value."""
|
||||
if self._values:
|
||||
|
Loading…
Reference in New Issue
Block a user