diff options
author | stuconnolly <stuart02@gmail.com> | 2013-01-11 18:22:24 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2013-01-11 18:22:24 +0000 |
commit | 2819529f8bcd239af9bd06c2310f7f8fc9900fd1 (patch) | |
tree | 80e3a67fd67304bfe14055dbd8f56dc7c8bd571b | |
parent | b0b4d3698cd9b873e63da5a95478d3369efd2b2d (diff) | |
download | sequelpro-2819529f8bcd239af9bd06c2310f7f8fc9900fd1.tar.gz sequelpro-2819529f8bcd239af9bd06c2310f7f8fc9900fd1.tar.bz2 sequelpro-2819529f8bcd239af9bd06c2310f7f8fc9900fd1.zip |
Minor tidy up.
-rw-r--r-- | Source/SPCustomQuery.m | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index 7c3083ec..2db65273 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -3711,14 +3711,12 @@ */ - (IBAction)filterQueryFavorites:(id)sender { - NSInteger i; NSMenu *menu = [queryFavoritesButton menu]; - NSString *searchPattern = [queryFavoritesSearchField stringValue]; - for (i = 7; i < [menu numberOfItems]; i++) + for (NSInteger i = 7; i < [menu numberOfItems]; i++) { [[menu itemAtIndex:i] setHidden:([[menu itemAtIndex:i] tag] != SP_FAVORITE_HEADER_MENUITEM_TAG - && ![[[menu itemAtIndex:i] title] isMatchedByRegex:[NSString stringWithFormat:@"(?i).*%@.*", searchPattern]])]; + && ![[[menu itemAtIndex:i] title] isMatchedByRegex:[NSString stringWithFormat:@"(?i).*%@.*", [queryFavoritesSearchField stringValue]]])]; } } @@ -3727,14 +3725,13 @@ */ - (IBAction)filterQueryHistory:(id)sender { - NSMenu *menu = [queryHistoryButton menu]; - NSUInteger numberOfItems = [menu numberOfItems]; - NSUInteger i; - NSString *searchPattern = [queryHistorySearchField stringValue]; NSArray *history = [[SPQueryController sharedQueryController] historyForFileURL:[tableDocumentInstance fileURL]]; - for (i = 7; i < numberOfItems; i++) + + NSMenu *menu = [queryHistoryButton menu]; + + for (NSInteger i = 7; i < [menu numberOfItems]; i++) { - [[menu itemAtIndex:i] setHidden:(![[history objectAtIndex:i-7] isMatchedByRegex:[NSString stringWithFormat:@"(?i).*%@.*", searchPattern]])]; + [[menu itemAtIndex:i] setHidden:(![[history objectAtIndex:i - 7] isMatchedByRegex:[NSString stringWithFormat:@"(?i).*%@.*", [queryHistorySearchField stringValue]]])]; } } |