aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableSource.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-11-15 23:58:21 +0000
committerrowanbeentje <rowan@beent.je>2009-11-15 23:58:21 +0000
commit50a283b6d1f3ce48e3a06eceeed3a466c6259fe7 (patch)
tree98596427c436f4735ec9baee45da66248e83291c /Source/TableSource.m
parent69a4fbc7cf11a35e5bf609cf7a16d2844559997c (diff)
downloadsequelpro-50a283b6d1f3ce48e3a06eceeed3a466c6259fe7.tar.gz
sequelpro-50a283b6d1f3ce48e3a06eceeed3a466c6259fe7.tar.bz2
sequelpro-50a283b6d1f3ce48e3a06eceeed3a466c6259fe7.zip
Implement query cancellation support within MCPKit, and add it to the task functionality:
- MCPKit now supports cancelling the active query; for MySQL servers >= 5.0.0 a query kill is attempted from a new connection, and if that fails or for MySQL < 5 a reconnect is triggered. - TableDocument now supports enabling a cancel task button on the task interface, including an optional callback - Implement query cancellation for custom queries. This addresses Issue #86. - Implement query cancellation for table content loads, filters, and sorts.
Diffstat (limited to 'Source/TableSource.m')
-rw-r--r--Source/TableSource.m16
1 files changed, 14 insertions, 2 deletions
diff --git a/Source/TableSource.m b/Source/TableSource.m
index 932d9cdd..6228e6f1 100644
--- a/Source/TableSource.m
+++ b/Source/TableSource.m
@@ -1033,8 +1033,20 @@ returns a dictionary containing enum/set field names as key and possible values
}
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
-{
- return [(aTableView == tableSourceView) ? [tableFields objectAtIndex:rowIndex] : [indexes objectAtIndex:rowIndex] objectForKey:[aTableColumn identifier]];
+{
+ NSDictionary *theRow;
+
+ if (aTableView == tableSourceView) {
+
+ // Return a placeholder if the table is reloading
+ if (rowIndex >= [tableFields count]) return @"...";
+
+ theRow = [tableFields objectAtIndex:rowIndex];
+ } else {
+ theRow = [indexes objectAtIndex:rowIndex];
+ }
+
+ return [theRow objectForKey:[aTableColumn identifier]];
}
- (void)tableView:(NSTableView *)aTableView setObjectValue:(id)anObject forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex