diff --git a/KnownIssues b/KnownIssues index 987021275..414848b75 100644 --- a/KnownIssues +++ b/KnownIssues @@ -1,4 +1 @@ -* Undo does not work for Playlist -> Clear -* UndoManager starts dropping old undo entries after 25 undos - on the stack. Memleak? - +Undo is broken badly when filtering. diff --git a/Playlist/PlaylistController.m b/Playlist/PlaylistController.m index e4199da77..8867e3849 100644 --- a/Playlist/PlaylistController.m +++ b/Playlist/PlaylistController.m @@ -517,13 +517,9 @@ - (IBAction)clear:(id)sender { - [currentEntry setIndex:[NSNumber numberWithInt:-1]]; + [self setFilterPredicate:nil]; - [self removeObjects:[self content]]; - [self updateTotalTime]; - - if (shuffle == YES) - [self resetShuffleList]; + [self removeObjectsAtArrangedObjectIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [[self arrangedObjects] count])]]; } - (IBAction)clearFilterPredicate:(id)sender