aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPQueryFavoriteManager.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPQueryFavoriteManager.m')
-rw-r--r--Source/SPQueryFavoriteManager.m9
1 files changed, 4 insertions, 5 deletions
diff --git a/Source/SPQueryFavoriteManager.m b/Source/SPQueryFavoriteManager.m
index 17818e87..db70e8f5 100644
--- a/Source/SPQueryFavoriteManager.m
+++ b/Source/SPQueryFavoriteManager.m
@@ -190,7 +190,6 @@
*/
- (IBAction)addQueryFavorite:(id)sender
{
-
NSMutableDictionary *favorite;
NSUInteger insertIndex;
@@ -198,16 +197,17 @@
[[self window] makeFirstResponder:favoriteNameTextField];
// Duplicate a selected favorite if sender == self
- if(sender == self)
+ if (sender == self)
favorite = [NSMutableDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[[favoriteNameTextField stringValue] stringByAppendingFormat:@" Copy"], [favoriteQueryTextView string], nil] forKeys:[NSArray arrayWithObjects:@"name", @"query", nil]];
// Add a new favorite
else
favorite = [NSMutableDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"New Favorite", @"", nil] forKeys:[NSArray arrayWithObjects:@"name", @"query", nil]];
- if([favoritesTableView numberOfSelectedRows] > 0) {
+ if ([favoritesTableView numberOfSelectedRows] > 0) {
insertIndex = [[favoritesTableView selectedRowIndexes] lastIndex]+1;
[favorites insertObject:favorite atIndex:insertIndex];
- } else {
+ }
+ else {
[favorites addObject:favorite];
insertIndex = [favorites count] - 1;
}
@@ -221,7 +221,6 @@
[removeButton setEnabled:([favoritesTableView numberOfSelectedRows] > 0)];
[[self window] makeFirstResponder:favoriteNameTextField];
-
}
/**