Skip to content

Commit

Permalink
fix 'setNeedsDisplay' is deprecated: first deprecated in macOS 10.14 (t…
Browse files Browse the repository at this point in the history
  • Loading branch information
Coeur authored and ckerr committed Jun 18, 2023
1 parent bc9e8e4 commit 90f8db7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions macosx/PiecesView.mm
Expand Up @@ -129,7 +129,7 @@ - (void)setTorrent:(Torrent*)torrent
self.image = [[NSImage alloc] initWithSize:self.bounds.size];

[self clearView];
[self setNeedsDisplay];
self.needsDisplay = YES;
}

- (void)clearView
Expand Down Expand Up @@ -196,7 +196,7 @@ - (void)updateView
NSRectFillListWithColors(cFillRects, cFillColors, numCells);
return YES;
}];
[self setNeedsDisplay];
self.needsDisplay = YES;
}

// save the current state so we can compare it later
Expand Down
8 changes: 7 additions & 1 deletion macosx/TorrentTableView.mm
Expand Up @@ -126,7 +126,13 @@ - (void)awakeFromNib
//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
Expand Down

0 comments on commit 90f8db7

Please sign in to comment.