aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-02-05 19:11:14 +0000
committerBibiko <bibiko@eva.mpg.de>2010-02-05 19:11:14 +0000
commit543e9593ff7878af9836df11c3eee3f6fce7101e (patch)
tree93afb255e838627f2678fda234266bc6c706e4c2 /Source
parent5698e7b63f0e187bb8b9d611cad4d6ec40412a4d (diff)
downloadsequelpro-543e9593ff7878af9836df11c3eee3f6fce7101e.tar.gz
sequelpro-543e9593ff7878af9836df11c3eee3f6fce7101e.tar.bz2
sequelpro-543e9593ff7878af9836df11c3eee3f6fce7101e.zip
Diffstat (limited to 'Source')
-rw-r--r--Source/CustomQuery.m12
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index 656b3063..8eb6184c 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -715,9 +715,9 @@
// Register new history item
[[SPQueryController sharedQueryController] addHistory:usedQuery forFileURL:[tableDocumentInstance fileURL]];
-
+
// Refresh history popup menu
- [self historyItemsHaveBeenUpdated:self];
+ [self performSelector:@selector(historyItemsHaveBeenUpdated:) withObject:self afterDelay:0.0];
}
// Error checking
@@ -1317,7 +1317,7 @@
[autouppercaseKeywordsMenuItem setState:([prefs boolForKey:SPCustomQueryAutoUppercaseKeywords]?NSOnState:NSOffState)];
if ( [[SPQueryController sharedQueryController] historyForFileURL:[tableDocumentInstance fileURL]] )
- [self historyItemsHaveBeenUpdated:self];
+ [self performSelector:@selector(historyItemsHaveBeenUpdated:) withObject:self afterDelay:0.0];
// Populate query favorites
[self queryFavoritesHaveBeenUpdated:nil];
@@ -2703,8 +2703,10 @@
while([queryHistoryButton numberOfItems] > 7)
[queryHistoryButton removeItemAtIndex:[queryHistoryButton numberOfItems]-1];
- for(id historyMenuItem in [[SPQueryController sharedQueryController] historyMenuItemsForFileURL:[tableDocumentInstance fileURL]])
- [historyMenu addItem:historyMenuItem];
+ NSUInteger numberOfHistoryItems = [[SPQueryController sharedQueryController] numberOfHistoryItemsForFileURL:[tableDocumentInstance fileURL]];
+ if(numberOfHistoryItems>0)
+ for(id historyMenuItem in [[SPQueryController sharedQueryController] historyMenuItemsForFileURL:[tableDocumentInstance fileURL]])
+ [historyMenu addItem:historyMenuItem];
}
/**
* Called by the query favorites manager whenever the query favorites have been updated.