Skip to content

Commit

Permalink
Fix a bug where shortcut preferences were not loaded successfully on …
Browse files Browse the repository at this point in the history
…macOS

This was because the settings keys for shortcuts contain the '.' character, which was also being used to encode the key's hierarchy instead of '/', so the setting was being loaded into a different path in the hierarchy. I'm not sure why this was originally done since '/' seems to still be a valid character for keys in plist files.
  • Loading branch information
cameronwhite committed Sep 17, 2023
1 parent 9b9cb6f commit ae699bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Thanks to the following contributors who worked on this release:
- Updated the minimum required version of `RtMidi` to 4.0

### Fixed
- Fixed a bug that caused some preferences such as custom shortcuts to not persist on macOS. Note that all other preferences (such as MIDI settings) are reset by this fix and will need to be manually changed to the desired values (#447).
- Fixed a frequent crash when the preference to play inserted notes while editing is enabled
- Fixed potential crashes when importing Guitar Pro files (#442, #444)
- Fixed a bug where the scroll bar's range did not update when the visible height of the score shrank (#443)
Expand Down
3 changes: 1 addition & 2 deletions source/util/settingstree_plist.mm
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void operator()(const SettingMap &map)
{
std::string prev_key = myKey;
if (!myKey.empty())
myKey += ".";
myKey += "/";
myKey += pair.first;

auto obj = std::visit(PListValueVisitor(), pair.second);
Expand Down Expand Up @@ -160,7 +160,6 @@ static SettingValue converToSettingValue(NSObject *obj)
for (NSString *key in [dict allKeys])
{
std::string key_str([key UTF8String]);
boost::replace_all(key_str, ".", "/");

NSObject *obj = [prefs objectForKey:key];
setImpl(key_str, converToSettingValue(obj));
Expand Down

0 comments on commit ae699bb

Please sign in to comment.