[Bugfix] Fix type mismatch when reading certain boolean config values #2556
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Config values
no_systrayandalways_ontopare saved as booleans (internally stored as strings in the .toml file); however, the code that uses these values attempts to read them with theget_intmethod. This method cannot parse the strings"True"and"False"and always defaults to 0 when encountering them.From
config.__init__.Config:Note that this docstring is misleading and does not represent the actual behavior of this method (or maybe I'm just stupid and can't catch its meaning).
This causes the application to de facto ignore these user settings. This PR fixes the problem by changing the related calls to
get_bool, also removing excessive constructions around them (e.g.,bool(config.get_int(...))).These changes also fix cases when EDMC would require a restart every time the user saved settings if
no_systrayis set to True.Another solution to this issue might be rewriting the
get_intmethod to make it correctly handle boolean-like strings similarly asget_booldoes.