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