diff --git a/English.lproj/MainMenu.nib/info.nib b/English.lproj/MainMenu.nib/info.nib
index 9fc7298e3..1abe0c681 100644
--- a/English.lproj/MainMenu.nib/info.nib
+++ b/English.lproj/MainMenu.nib/info.nib
@@ -34,14 +34,14 @@
4
IBOpenObjects
- 1063
- 29
268
21
1156
- 1324
513
463
+ 1324
+ 29
+ 1063
IBSystem Version
8R2218
diff --git a/English.lproj/MainMenu.nib/keyedobjects.nib b/English.lproj/MainMenu.nib/keyedobjects.nib
index 3e974c716..fa99befd3 100644
Binary files a/English.lproj/MainMenu.nib/keyedobjects.nib and b/English.lproj/MainMenu.nib/keyedobjects.nib differ
diff --git a/Playlist/PlaylistController.m b/Playlist/PlaylistController.m
index 9add51136..0496802af 100644
--- a/Playlist/PlaylistController.m
+++ b/Playlist/PlaylistController.m
@@ -161,11 +161,30 @@
- (void)removeObjectsAtArrangedObjectIndexes:(NSIndexSet *)indexes
{
- NSArray *a = [[self arrangedObjects] objectsAtIndexes:indexes]; //Screw 10.3
+ NSLog(@"Removing indexes: %@", indexes);
+ NSLog(@"Current index: %i", [[currentEntry index] intValue]);
- if ([a containsObject:currentEntry])
+ if ([[currentEntry index] intValue] >= 0 && [indexes containsIndex:[[currentEntry index] intValue]])
{
- [currentEntry setIndex:[NSNumber numberWithInt:-1]];
+ [currentEntry setIndex:[NSNumber numberWithInt:-[[currentEntry index] intValue] - 1]];
+ NSLog(@"Current removed: %i", [[currentEntry index] intValue]);
+ }
+
+ if ([[currentEntry index] intValue] < 0) //Need to update the negative index
+ {
+ int i = -[[currentEntry index] intValue] - 1;
+ NSLog(@"I is %i", i);
+ int j;
+ for (j = i - 1; j >= 0; j--)
+ {
+ if ([indexes containsIndex:j]) {
+ NSLog(@"Removing 1");
+ i--;
+ }
+ }
+ [currentEntry setIndex: [NSNumber numberWithInt:-i - 1]];
+
+ NSLog(@"UPDATING INDEX: %@", [currentEntry index]);
}
[super removeObjectsAtArrangedObjectIndexes:indexes];
@@ -290,7 +309,17 @@
}
else
{
- return [self entryAtIndex:([[pe index] intValue] + 1)];
+ int i;
+ if ([[pe index] intValue] < 0) //Was a current entry, now removed.
+ {
+ i = -[[pe index] intValue] - 1;
+ }
+ else
+ {
+ i = [[pe index] intValue] + 1;
+ }
+
+ return [self entryAtIndex:i];
}
}
@@ -302,15 +331,17 @@
}
else
{
- //Fix for removing a track, then pressing prev with repeat turned on
- if ([[pe index] intValue] == -1)
+ int i;
+ if ([[pe index] intValue] < 0) //Was a current entry, now removed.
{
- return [self entryAtIndex:[[pe index] intValue]];
+ i = -[[pe index] intValue] - 2;
}
else
{
- return [self entryAtIndex:[[pe index] intValue] - 1];
+ i = [[pe index] intValue] - 1;
}
+
+ return [self entryAtIndex:i];
}
}