wayland: Move m_layoutList assignment out of Xkb::applyEnvironmentRules

Xkb::applyEnvironmentRules is meant to do just that, move the unrelated
code outside.
This commit is contained in:
Fabian Vogt 2021-12-20 18:08:30 +01:00 committed by Vlad Zahorodnii
parent cfa463c0ef
commit 677f5fcb6e

View file

@ -171,8 +171,6 @@ void Xkb::applyEnvironmentRules(xkb_rule_names &ruleNames)
if (ruleNames.options == nullptr) {
ruleNames.options = getenv("XKB_DEFAULT_OPTIONS");
}
m_layoutList = QString::fromLatin1(ruleNames.layout).split(QLatin1Char(','));
}
xkb_keymap *Xkb::loadKeymapFromConfig()
@ -200,6 +198,8 @@ xkb_keymap *Xkb::loadKeymapFromConfig()
applyEnvironmentRules(ruleNames);
m_layoutList = QString::fromLatin1(ruleNames.layout).split(QLatin1Char(','));
return xkb_keymap_new_from_names(m_context, &ruleNames, XKB_KEYMAP_COMPILE_NO_FLAGS);
}
@ -207,6 +207,7 @@ xkb_keymap *Xkb::loadDefaultKeymap()
{
xkb_rule_names ruleNames = {};
applyEnvironmentRules(ruleNames);
m_layoutList = QString::fromLatin1(ruleNames.layout).split(QLatin1Char(','));
return xkb_keymap_new_from_names(m_context, &ruleNames, XKB_KEYMAP_COMPILE_NO_FLAGS);
}