Only emit changed in unset if there was a change
This commit is contained in:
parent
8fead148e2
commit
ab119975e7
@ -255,7 +255,8 @@ class YamlConfig(QObject):
|
||||
|
||||
def unset(self, name, *, pattern=None):
|
||||
"""Remove the given option name if it's configured."""
|
||||
self._values[name].remove(pattern)
|
||||
changed = self._values[name].remove(pattern)
|
||||
if changed:
|
||||
self._mark_changed()
|
||||
|
||||
def clear(self):
|
||||
|
@ -110,7 +110,9 @@ class Values:
|
||||
def remove(self, pattern=None):
|
||||
"""Remove the value with the given pattern."""
|
||||
# FIXME:conf Should this ignore patterns which weren't found?
|
||||
old_len = len(self._values)
|
||||
self._values = [v for v in self._values if v.pattern != pattern]
|
||||
return old_len != len(self._values)
|
||||
|
||||
def clear(self):
|
||||
"""Clear all customization for this value."""
|
||||
|
Loading…
Reference in New Issue
Block a user