diff --git a/InfoInspector/InfoWindowController.m b/InfoInspector/InfoWindowController.m index 2806952f0..dba3f1f99 100644 --- a/InfoInspector/InfoWindowController.m +++ b/InfoInspector/InfoWindowController.m @@ -8,6 +8,7 @@ #import "InfoWindowController.h" #import "MissingAlbumArtTransformer.h" +#import "PlaylistEntry.h" #import "Logging.h" #import "AppController.h" @@ -36,19 +37,13 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { - BOOL miniMode = [appController miniMode]; - BOOL currentEntryChanged = (object == currentEntryController && [keyPath isEqualTo:@"content"]); - BOOL selectionChanged = (object == playlistSelectionController && [keyPath isEqualTo:@"selection"]); - BOOL miniModeSwitched = (object == appController && [keyPath isEqual:@"miniMode"]); - - if (miniMode && (currentEntryChanged || miniModeSwitched)) - { + // Avoid "selection" because it creates a proxy that's hard to reason with when we don't need to write. + PlaylistEntry* currentSelection = [[playlistSelectionController selectedObjects] firstObject]; + if (currentSelection != NULL) { + [self setValueToDisplay: currentSelection]; + } else { [self setValueToDisplay:[currentEntryController content]]; } - else if (!miniMode && (selectionChanged || miniModeSwitched)) - { - [self setValueToDisplay:[playlistSelectionController selection]]; - } } - (IBAction)toggleWindow:(id)sender