Skip to content

kcms/region_language: make removing languages work

Reason for the change

Somewhat confusingly, the "hasImplicitLang" doesn't report whether LANG is set implicitly, but whether both LANG and LANGUAGE are the default value. This is tested through the default value set in the kcfg file, which is the environment variable if it is set. Most methods changing a value are already setting hasImplicitLang to false as part of their operation; but remove does not. If either environment variable is set, so is the hasImplicitLang property. Saving the languages checks for that property, and will do nothing if it is true. Consequently, if the environment variable is set, removing an entry from the list will remove it from the list, but will not save this as the change is not propagated from the selected languages model to the settings model.

This change sets hasImplicitLang to false on removal of a language, like replacing, adding, and reordering already do.

Test plan

  1. Open kcm, Language > Modify, set two or more languages. May need to logout/login.
  2. Open kcm, Language > Modify, press the red list-remove button.
  3. Without patch: language is removed from list, but kcm is not marked as changed (Apply button disabled). Restarting the kcm finds the removed language back.
  4. With patch: kcm allows saving the changes; if you do, the removed language does not come back.

Screenshots or screen recordings

N/A

Bugs fixed

N/A

Cherry-picking into 6.3 suggested, as functionality is broken.

Merge request reports

Loading