From a2d64457e1c52d2d72863407537e950c80595231 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Tue, 1 Jun 2010 00:10:02 +0000 Subject: - Ensure start/end query notifications are sent on the main thread to avoid the interface being updated from the wrong thread on listeners - Add a "Support Files" folder to MCPKit, containing NSNotificationAdditions to support main thread notifications from within MCPKit --- Source/SPDatabaseDocument.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/SPDatabaseDocument.m') diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 92f83a79..72cf201b 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -1085,7 +1085,7 @@ NSString *dbName = nil; // Notify listeners that a query has started - [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryWillBePerformed" object:self]; + [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:@"SMySQLQueryWillBePerformed" object:self]; MCPResult *theResult = [mySQLConnection queryString:@"SELECT DATABASE()"]; if (![mySQLConnection queryErrored]) { @@ -1110,7 +1110,7 @@ } //query finished - [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:self]; + [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:@"SMySQLQueryHasBeenPerformed" object:self]; } - (BOOL)navigatorSchemaPathExistsForDatabase:(NSString*)dbname -- cgit v1.2.3