From 1490a19ad1580a5c659b504ffeffe0c2df4513b2 Mon Sep 17 00:00:00 2001 From: rogerman Date: Thu, 7 Apr 2022 18:21:30 -0700 Subject: [PATCH] Cocoa Port: Fix a GUI bug where adding or removing an input mapping in Input Preferences may occasionally cause its outline view to fail to update under certain OS/build combinations. - I solved it by simply reloading the entire outline view instead of picking and choosing specific items to reload. Due to the relatively few amount of items in the outline view (less than 1000 items), reloading the entire outline view is still very fast, even on a PowerPC Mac. --- .../frontend/cocoa/userinterface/inputPrefsView.mm | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/desmume/src/frontend/cocoa/userinterface/inputPrefsView.mm b/desmume/src/frontend/cocoa/userinterface/inputPrefsView.mm index 4fb988fc2..d9c246285 100644 --- a/desmume/src/frontend/cocoa/userinterface/inputPrefsView.mm +++ b/desmume/src/frontend/cocoa/userinterface/inputPrefsView.mm @@ -324,15 +324,7 @@ [inputPrefOutlineView deselectRow:rowNumber]; } - // Update all expanded command tags. - for (NSString *tag in inputMappings) - { - NSArray *inputList = (NSArray *)[inputMappings valueForKey:tag]; - if ([inputPrefOutlineView isItemExpanded:inputList]) - { - [inputPrefOutlineView reloadItem:inputList reloadChildren:YES]; - } - } + [inputPrefOutlineView reloadItem:nil reloadChildren:YES]; [self setConfigInputTargetID:nil]; @@ -793,7 +785,7 @@ [inputManager removeMappingUsingDeviceCode:[(NSString *)[deviceInfo valueForKey:@"deviceCode"] cStringUsingEncoding:NSUTF8StringEncoding] elementCode:[(NSString *)[deviceInfo valueForKey:@"elementCode"] cStringUsingEncoding:NSUTF8StringEncoding]]; [inputManager writeDefaultsInputMappings]; - [outlineView reloadItem:inputList reloadChildren:YES]; + [outlineView reloadItem:nil reloadChildren:YES]; // If we're dealing with a Microphone command, update the audio file generators list. if ([[inputManager commandTagFromInputList:inputList] isEqualToString:@"Microphone"])