Browse Source

macosx: Nilify inputItem/representedItem when one is set over the other in VLCLibraryTableCellView

Helps make the switch over in time more obvious and also ensures certain
procedures (e.g. checking if the current item/input item has changed
during async thumbnail fetch) can properly detech item changes

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
pull/175/head
Claudio Cambra 2 years ago
committed by Steve Lhomme
parent
commit
91cc4092bf
  1. 3
      modules/gui/macosx/library/VLCLibraryTableCellView.m

3
modules/gui/macosx/library/VLCLibraryTableCellView.m

@ -72,6 +72,8 @@ NSString * const VLCLibraryTableCellViewIdentifier = @"VLCLibraryTableCellViewId
- (void)setRepresentedItem:(VLCLibraryRepresentedItem *)representedItem
{
_representedItem = representedItem;
_representedInputItem = nil; // Reset and ensure the change is obvious
id<VLCMediaLibraryItemProtocol> const actualItem = representedItem.item;
NSAssert(actualItem != nil, @"Should not update nil represented item!");
@ -100,6 +102,7 @@ NSString * const VLCLibraryTableCellViewIdentifier = @"VLCLibraryTableCellViewId
- (void)setRepresentedInputItem:(VLCInputItem *)representedInputItem
{
_representedInputItem = representedInputItem;
_representedItem = nil; // Reset and ensure the change is obvious
self.singlePrimaryTitleTextField.hidden = NO;
self.singlePrimaryTitleTextField.stringValue = _representedInputItem.name;

Loading…
Cancel
Save