From a24149dc10fc02f429e424772f85c0071d4fc5cf Mon Sep 17 00:00:00 2001 From: vspader Date: Sun, 10 Feb 2008 19:46:45 +0000 Subject: [PATCH] Fixed undo for clear. --- KnownIssues | 5 +---- Playlist/PlaylistController.m | 8 ++------ 2 files changed, 3 insertions(+), 10 deletions(-) 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