From 1d7ed99d602bf9c7aa4ea40a9a2ab6458864e51f Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Sun, 22 Jan 2012 12:19:21 +0000 Subject: Bring outlinew view branch up to date with trunk (r3375:3468). --- Source/SPGeneralPreferencePane.m | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Source/SPGeneralPreferencePane.m') diff --git a/Source/SPGeneralPreferencePane.m b/Source/SPGeneralPreferencePane.m index fc2b4014..4a263be4 100644 --- a/Source/SPGeneralPreferencePane.m +++ b/Source/SPGeneralPreferencePane.m @@ -96,12 +96,7 @@ static NSString *SPDatabaseImage = @"database-small"; } // Select the default favorite from prefs - if (![prefs boolForKey:SPSelectLastFavoriteUsed]) { - [defaultFavoritePopup selectItemWithTag:[prefs integerForKey:SPDefaultFavorite]]; - } - else { - [defaultFavoritePopup selectItemAtIndex:0]; - } + [self updateDefaultFavoritePopupSelection]; } #pragma mark - @@ -161,6 +156,13 @@ static NSString *SPDatabaseImage = @"database-small"; return items; } +- (void)updateDefaultFavoritePopupSelection +{ + NSUInteger index = [prefs integerForKey:SPDefaultFavorite]; + + [defaultFavoritePopup selectItemAtIndex:(![prefs boolForKey:SPSelectLastFavoriteUsed] && index > 0 && index < [[defaultFavoritePopup itemArray] count]) ? index + 2 : 0]; +} + #pragma mark - #pragma mark Preference pane protocol methods -- cgit v1.2.3