Fix set name key conversion on set switch - #1357
Conversation
Set names with spaces or other XML-special characters caused a parser error on startup when used as XML tag names (e.g. 'Short set' became <parallel_set_Short set> which is invalid XML). Fix: automatically convert spaces to underscores when storing set names as XML keys, and convert back for display in the UI. New helpers in settings.c: name_to_key(name) - convert display name to XML key (space -> _) key_to_name(key) - convert XML key to display name (_ -> space) Fixes crash on startup when a parallel set name contains a space.
When switching sets via the ComboBox, the displayed name (with spaces) was being stored directly in settings.xml instead of the XML key (with underscores), causing a mismatch on next startup. Apply name_to_key() before storing parallel_set_current and before calling get_parallel_set() when switching sets.
|
I hope this works! I've run several tests and it seems to be working... |
|
sigh Try again. |
|
@karlkleinpaste Not sure what you're doing to pull a patch file like that and apply it. You can just directly check out his branch. Two main ways: If you do not have the Github client installed
If you DO have the Github client installed
|
I do what I've always done wtih GH PRs: I add ".patch" to the url, save that patch file, and apply it in a clean branch from master (or in my local master itself, if I don't want to bother creating a temp local branch, because cleaning up the results of an applied patch is easy) with |
|
I'd suggest choosing either the native Git method or setting up the Github CLI client. Either one makes testing PRs a far smoother experience! |
When switching sets via the ComboBox, the displayed name (with spaces)
was being stored directly in settings.xml instead of the XML key
(with underscores), causing a mismatch on next startup.
Apply name_to_key() before storing parallel_set_current and before
calling get_parallel_set() when switching sets.