Skip to content

Commit

Permalink
Fix removing immutable settings for lists
Browse files Browse the repository at this point in the history
Settings can have multiple values, although this is not often used and
the UI has places where this is not properly honored. Fix the case
where we look for and prune uninitialized/immutable settings and
be sure to iterate over all the values to avoid a crash.

Fixes #11549
  • Loading branch information
kk7ds committed Sep 19, 2024
1 parent 673dcb4 commit a03e639
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions chirp/wxui/settingsedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,13 @@ def _remove_dead_settings(self, root):
if isinstance(e, settings.RadioSetting):
# Immutable and uninitialized settings don't get sent to the
# radio
if not e.value.get_mutable():
LOG.debug('Skipping immutable %s', e.get_name())
del root[e]
elif not e.value.initialized:
LOG.debug('Skipping uninitialized %s', e.get_name())
del root[e]
for value in e:
if not value.get_mutable():
LOG.debug('Skipping immutable %s', e.get_name())
del root[e]
elif not value.initialized:
LOG.debug('Skipping uninitialized %s', e.get_name())
del root[e]
elif isinstance(e, settings.RadioSettingGroup):
self._remove_dead_settings(e)

Expand Down

0 comments on commit a03e639

Please sign in to comment.