Skip to content

Commit

Permalink
Simplify NSContentBinding/NSContentValuesBindings in setValue:forKey:…
Browse files Browse the repository at this point in the history
… and valueForKey:
  • Loading branch information
gcasa committed Oct 14, 2024
1 parent 664fdad commit 5a16976
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions Source/NSBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -3759,23 +3759,15 @@ @implementation NSBrowser (GSBindingsPrivate)

- (void) setValue: (id)anObject forKey: (NSString*)aKey
{
if ([aKey isEqual: NSContentBinding])
if ([aKey isEqual: NSContentBinding]
|| [aKey isEqual: NSContentValuesBinding])
{
// Reload data
_passiveDelegate = NO;
_itemBasedDelegate = YES;

[self loadColumnZero];
NSDebugLLog(@"NSBinding", @"Setting browser view content to %@", anObject);
}
else if ([aKey isEqual: NSContentValuesBinding])
{
// Reload data
_passiveDelegate = NO;
_itemBasedDelegate = YES;

[self loadColumnZero];
NSDebugLLog(@"NSBinding", @"Setting browser view content values to %@", anObject);
NSDebugLLog(@"NSBinding", @"Setting browser view content/values to %@", anObject);
}
else
{
Expand All @@ -3785,11 +3777,8 @@ - (void) setValue: (id)anObject forKey: (NSString*)aKey

- (id) valueForKey: (NSString*)aKey
{
if ([aKey isEqual: NSContentBinding])
{
return nil;
}
else if ([aKey isEqual: NSContentValuesBinding])
if ([aKey isEqual: NSContentBinding]
|| [aKey isEqual: NSContentValuesBinding])
{
return nil;
}
Expand Down

0 comments on commit 5a16976

Please sign in to comment.