From 9ed7bc2eaa45f6c06477d37ccf206575e06f2187 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Fri, 18 Dec 2009 20:19:03 +0000 Subject: Random source tidy up changes. --- Source/CustomQuery.m | 12 ++---------- Source/SPQueryFavoriteManager.m | 9 ++++----- Source/SPTableRelations.h | 2 -- 3 files changed, 6 insertions(+), 17 deletions(-) (limited to 'Source') diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m index 0982e16f..4805ea45 100644 --- a/Source/CustomQuery.m +++ b/Source/CustomQuery.m @@ -1219,7 +1219,6 @@ // Populate query favorites [self queryFavoritesHaveBeenUpdated:nil]; - // Disable runSelectionMenuItem in the gear menu [runSelectionMenuItem setEnabled:NO]; @@ -2613,15 +2612,14 @@ * Called by the query favorites manager whenever the query favorites have been updated. */ - (void)queryFavoritesHaveBeenUpdated:(id)manager -{ - +{ NSMenuItem *headerMenuItem; NSMenu *menu = [queryFavoritesButton menu]; // Remove all favorites beginning from the end while([queryFavoritesButton numberOfItems] > 7) [queryFavoritesButton removeItemAtIndex:[queryFavoritesButton numberOfItems]-1]; - + // Build document-based list headerMenuItem = [[NSMenuItem alloc] initWithTitle: [[[[tableDocumentInstance fileURL] absoluteString] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding] lastPathComponent] @@ -2655,9 +2653,6 @@ [menu addItem:item]; [item release]; } - - // [queryFavoritesSearchField setStringValue:@""]; - } #pragma mark - @@ -2789,7 +2784,6 @@ */ - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { - // Control "Save ... to Favorites" if ( [menuItem tag] == SP_SAVE_SELECTION_FAVORTITE_MENUITEM_TAG ) { if ([[textView string] length] < 1) return NO; @@ -2812,10 +2806,8 @@ } return YES; - } - #pragma mark - - (id)init 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]; - } /** diff --git a/Source/SPTableRelations.h b/Source/SPTableRelations.h index 66424d20..fb32fd12 100644 --- a/Source/SPTableRelations.h +++ b/Source/SPTableRelations.h @@ -26,8 +26,6 @@ #import #import -@class CMCopyTable; - @interface SPTableRelations : NSObject { IBOutlet id tableDocumentInstance; -- cgit v1.2.3