From bd9d110d4583ad8721cb8d75c3c51fbc8061d69b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C5=93ur?= Date: Sun, 18 Jun 2023 20:32:34 +0200 Subject: [PATCH] fix 'setNeedsDisplay' is deprecated: first deprecated in macOS 10.14 (#5633) --- macosx/PiecesView.mm | 4 ++-- macosx/TorrentTableView.mm | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/macosx/PiecesView.mm b/macosx/PiecesView.mm index 69c4c1f43..4294d872c 100644 --- a/macosx/PiecesView.mm +++ b/macosx/PiecesView.mm @@ -129,7 +129,7 @@ typedef struct PieceInfo self.image = [[NSImage alloc] initWithSize:self.bounds.size]; [self clearView]; - [self setNeedsDisplay]; + self.needsDisplay = YES; } - (void)clearView @@ -196,7 +196,7 @@ typedef struct PieceInfo NSRectFillListWithColors(cFillRects, cFillColors, numCells); return YES; }]; - [self setNeedsDisplay]; + self.needsDisplay = YES; } // save the current state so we can compare it later diff --git a/macosx/TorrentTableView.mm b/macosx/TorrentTableView.mm index 28f9a0ce6..b88604772 100644 --- a/macosx/TorrentTableView.mm +++ b/macosx/TorrentTableView.mm @@ -126,7 +126,13 @@ static NSTimeInterval const kToggleProgressSeconds = 0.175; //disable highlight color and set manually in drawRow [self setSelectionHighlightStyle:NSTableViewSelectionHighlightStyleNone]; - [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(setNeedsDisplay) name:@"RefreshTorrentTable" object:nil]; + [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(refreshTorrentTable) name:@"RefreshTorrentTable" + object:nil]; +} + +- (void)refreshTorrentTable +{ + self.needsDisplay = YES; } - (BOOL)isGroupCollapsed:(NSInteger)value