Handle wayland decoration option rename through configdata.yml
This commit is contained in:
parent
6db1ab0a58
commit
e211801e16
@ -1533,6 +1533,9 @@ url.yank_ignored_parameters:
|
||||
|
||||
## window
|
||||
|
||||
window.hide_wayland_decoration:
|
||||
renamed: window.hide_decoration
|
||||
|
||||
window.hide_decoration:
|
||||
type: Bool
|
||||
default: false
|
||||
|
@ -262,17 +262,6 @@ class YamlConfig(QObject):
|
||||
del settings[old]
|
||||
self._mark_changed()
|
||||
|
||||
# window.hide_wayland_decoration was replaced by a more system agnostic
|
||||
# Qt based equivalent
|
||||
old = 'window.hide_wayland_decoration'
|
||||
new = 'window.hide_decoration'
|
||||
if old in settings:
|
||||
settings[new] = {}
|
||||
for scope, val in settings[old].items():
|
||||
settings[new][scope] = val
|
||||
del settings[old]
|
||||
self._mark_changed()
|
||||
|
||||
# bindings.default can't be set in autoconfig.yml anymore, so ignore
|
||||
# old values.
|
||||
if 'bindings.default' in settings:
|
||||
|
@ -223,18 +223,6 @@ class TestYaml:
|
||||
mode = 'persist' if persist else 'normal'
|
||||
assert data['tabs.mode_on_change']['global'] == mode
|
||||
|
||||
@pytest.mark.parametrize('hide_decoration', [True, False])
|
||||
def test_decoration_hiding(self, yaml, autoconfig, hide_decoration):
|
||||
"""Tests for migration of window.hide_wayland_decoration"""
|
||||
old = {'window.hide_wayland_decoration': {'global': hide_decoration}}
|
||||
autoconfig.write(old)
|
||||
yaml.load()
|
||||
yaml._save()
|
||||
|
||||
data = autoconfig.read()
|
||||
assert 'window.hide_wayland_decoration' not in data
|
||||
assert data['window.hide_decoration']['global'] == hide_decoration
|
||||
|
||||
def test_bindings_default(self, yaml, autoconfig):
|
||||
"""Make sure bindings.default gets removed from autoconfig.yml."""
|
||||
autoconfig.write({'bindings.default': {'global': '{}'}})
|
||||
|
Loading…
Reference in New Issue
Block a user