aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPGeneralPreferencePane.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPGeneralPreferencePane.m')
-rw-r--r--Source/SPGeneralPreferencePane.m14
1 files changed, 8 insertions, 6 deletions
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