diff options
author | rowanbeentje <rowan@beent.je> | 2010-06-01 00:10:02 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2010-06-01 00:10:02 +0000 |
commit | a2d64457e1c52d2d72863407537e950c80595231 (patch) | |
tree | ef59124222e77a56bcf88ce446626bd6aa6e8eed /Source/SPTableStructure.m | |
parent | f5e5d40e5e9569470e52cbaaba4d4352dc2a71d7 (diff) | |
download | sequelpro-a2d64457e1c52d2d72863407537e950c80595231.tar.gz sequelpro-a2d64457e1c52d2d72863407537e950c80595231.tar.bz2 sequelpro-a2d64457e1c52d2d72863407537e950c80595231.zip |
- 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
Diffstat (limited to 'Source/SPTableStructure.m')
-rw-r--r-- | Source/SPTableStructure.m | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m index e14e76a1..74cae1c3 100644 --- a/Source/SPTableStructure.m +++ b/Source/SPTableStructure.m @@ -67,7 +67,7 @@ } // Send the query started/working notification - [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryWillBePerformed" object:tableDocumentInstance]; + [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:@"SMySQLQueryWillBePerformed" object:tableDocumentInstance]; // Retrieve the column information for this table. // TODO: update this and indexes to use TableData at some point - tiny bit more parsing required... @@ -75,7 +75,7 @@ // If an error occurred, reset the interface and abort if ([mySQLConnection queryErrored]) { - [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:tableDocumentInstance]; + [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:@"SMySQLQueryHasBeenPerformed" object:tableDocumentInstance]; [[self onMainThread] setTableDetails:nil]; if ([mySQLConnection isConnected]) { @@ -97,7 +97,7 @@ // If an error occurred, reset the interface and abort if ([mySQLConnection queryErrored]) { - [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:tableDocumentInstance]; + [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:@"SMySQLQueryHasBeenPerformed" object:tableDocumentInstance]; [[self onMainThread] setTableDetails:nil]; if ([mySQLConnection isConnected]) { @@ -192,7 +192,7 @@ [[self onMainThread] setTableDetails:tableDetails]; // Send the query finished/work complete notification - [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:tableDocumentInstance]; + [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:@"SMySQLQueryHasBeenPerformed" object:tableDocumentInstance]; } |