aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CustomQuery.m10
-rw-r--r--Source/SPQueryController.m2
2 files changed, 3 insertions, 9 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index e21d6931..e586557e 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -712,15 +712,9 @@
}
// add query to history
- // if(!queriesSeparatedByDelimiter) { // TODO only add to history if no “delimiter” command was used
- if(!reloadingExistingResult && [usedQuery length]) {
-
- // Register new history item
+ if(!reloadingExistingResult && [usedQuery length])
[[SPQueryController sharedQueryController] addHistory:usedQuery forFileURL:[tableDocumentInstance fileURL]];
-
- // Refresh history popup menu
- [self performSelector:@selector(historyItemsHaveBeenUpdated:) withObject:self afterDelay:0.0];
- }
+
// Error checking
if ( [mySQLConnection queryCancelled] || ([errors length] && !queryIsTableSorter)) {
diff --git a/Source/SPQueryController.m b/Source/SPQueryController.m
index e19a49e5..8b1b6c8e 100644
--- a/Source/SPQueryController.m
+++ b/Source/SPQueryController.m
@@ -589,7 +589,7 @@ static SPQueryController *sharedQueryController = nil;
// Inform all opened documents to update the history list
for(id doc in [[NSDocumentController sharedDocumentController] documents])
if([[doc valueForKeyPath:@"customQueryInstance"] respondsToSelector:@selector(historyItemsHaveBeenUpdated:)])
- [[doc valueForKeyPath:@"customQueryInstance"] historyItemsHaveBeenUpdated:self];
+ [[doc valueForKeyPath:@"customQueryInstance"] performSelectorOnMainThread:@selector(historyItemsHaveBeenUpdated:) withObject:self waitUntilDone:NO];
}