diff --git a/qutebrowser/config/sections.py b/qutebrowser/config/sections.py index 3a79e42a4..f1ae0b681 100644 --- a/qutebrowser/config/sections.py +++ b/qutebrowser/config/sections.py @@ -68,7 +68,7 @@ class Section: """Get value keys.""" return self.values.keys() - def setv(self, layer, key, value, interpolated): + def setv(self, layer, key, value, interpolated=None): """Set the value on a layer. Args: @@ -111,7 +111,7 @@ class KeyValue(Section): self.values[k] = v self.descriptions[k] = desc - def setv(self, layer, key, value, interpolated): + def setv(self, layer, key, value, interpolated=None): self.values[key].setv(layer, value, interpolated) def dump_userconfig(self): @@ -165,7 +165,7 @@ class ValueList(Section): self.values = ChainMap(self.layers['temp'], self.layers['conf'], self.layers['default']) - def setv(self, layer, key, value, interpolated): + def setv(self, layer, key, value, interpolated=None): self.keytype().validate(key) if key in self.layers[layer]: self.layers[layer][key].setv(layer, value, interpolated) diff --git a/qutebrowser/config/value.py b/qutebrowser/config/value.py index 5a12177c5..11957ecf7 100644 --- a/qutebrowser/config/value.py +++ b/qutebrowser/config/value.py @@ -90,7 +90,7 @@ class SettingValue: v = self.value return self.typ.transform(v) - def setv(self, layer, value, interpolated): + def setv(self, layer, value, interpolated=None): """Set the value on a layer. Args: @@ -98,6 +98,8 @@ class SettingValue: ValueLayers dict. value: The value to set. interpolated: The interpolated value, for typechecking. + If None, no checks get performed. """ - self.typ.validate(interpolated) + if interpolated is not None: + self.typ.validate(interpolated) self._values[layer] = value