From efc5a0e98e86838300426606e8e649bdb96f68f6 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Thu, 4 Nov 2010 00:11:47 +0000 Subject: - Fix problems updating the default favourite pop following the preference changes - this addresses http://spbug.com/l/1774 - Fix reselection of a newly reordered favourite - When reordering favourites downwards, move them to the correct position instead of one position too low --- Source/SPConnectionController.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Source/SPConnectionController.m') diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index 11339ace..d356bc89 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -1051,7 +1051,7 @@ [favoritesTable selectRowIndexes:[NSIndexSet indexSetWithIndex:[favorites count]-1] byExtendingSelection:NO]; [favoritesTable scrollRowToVisible:[favoritesTable selectedRow]]; - [[[NSApp delegate] preferenceController] updateDefaultFavoritePopup]; + [[[[NSApp delegate] preferenceController] generalPreferencePane] updateDefaultFavoritePopup]; } /** @@ -1120,24 +1120,24 @@ } NSMutableDictionary *draggedFavorite = [favorites objectAtIndex:dragRow]; [favorites removeObjectAtIndex:dragRow]; - if (row > [favorites count]) + if (row > dragRow) { row--; } [favorites insertObject:draggedFavorite atIndex:row]; [aTableView reloadData]; - [aTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; // reset the prefs with the new order NSMutableArray *reorderedFavorites = [[NSMutableArray alloc] initWithArray:favorites]; [reorderedFavorites removeObjectAtIndex:0]; [prefs setObject:reorderedFavorites forKey:SPFavorites]; - [[[NSApp delegate] preferenceController] updateDefaultFavoritePopup]; + [[[[NSApp delegate] preferenceController] generalPreferencePane] updateDefaultFavoritePopup]; [reorderedFavorites release]; [self updateFavorites]; + [aTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; acceptedDrop = YES; -- cgit v1.2.3