Playlist View: Refresh playlist entries when queue is emptied

CQTexperiment
Christopher Snowhill 2022-01-20 17:58:24 -08:00
parent 973664f3b3
commit 4e918fc868
1 changed files with 7 additions and 0 deletions

View File

@ -1088,12 +1088,19 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
} }
- (void)emptyQueueListUnsynced { - (void)emptyQueueListUnsynced {
NSMutableIndexSet * refreshSet = [[NSMutableIndexSet alloc] init];
for (PlaylistEntry *queueItem in queueList) { for (PlaylistEntry *queueItem in queueList) {
queueItem.queued = NO; queueItem.queued = NO;
[queueItem setQueuePosition:-1]; [queueItem setQueuePosition:-1];
[refreshSet addIndex:[queueItem index]];
} }
[queueList removeAllObjects]; [queueList removeAllObjects];
// Refresh entire row to refresh tooltips
unsigned long columns = [[self.tableView tableColumns] count];
[self.tableView reloadDataForRowIndexes:refreshSet columnIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, columns)]];
} }
- (IBAction)toggleQueued:(id)sender { - (IBAction)toggleQueued:(id)sender {