aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableContent.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-07-21 00:04:41 +0000
committerstuconnolly <stuart02@gmail.com>2009-07-21 00:04:41 +0000
commit8c47108f6de8d04fa7d1cf7dbfc8a4fd423979f5 (patch)
tree766c97b0f5e82d2e9e39b1f4afa5e4de2f116092 /Source/TableContent.m
parentc506398bb7f92644c04f542c067a761e8eee77ee (diff)
downloadsequelpro-8c47108f6de8d04fa7d1cf7dbfc8a4fd423979f5.tar.gz
sequelpro-8c47108f6de8d04fa7d1cf7dbfc8a4fd423979f5.tar.bz2
sequelpro-8c47108f6de8d04fa7d1cf7dbfc8a4fd423979f5.zip
Improvements to reporting the correct row count for tables. See issue #141.
Diffstat (limited to 'Source/TableContent.m')
-rw-r--r--Source/TableContent.m20
1 files changed, 10 insertions, 10 deletions
diff --git a/Source/TableContent.m b/Source/TableContent.m
index 8bcf4942..2e7d32c2 100644
--- a/Source/TableContent.m
+++ b/Source/TableContent.m
@@ -1651,7 +1651,7 @@
}
}
-/*
+/**
* Show Error sheet (can be called from inside of a endSheet selector)
* via [self performSelector:@selector(showErrorSheetWithTitle:) withObject: afterDelay:]
*/
@@ -1664,7 +1664,7 @@
}
-/*
+/**
* Returns the number of rows in the selected table
* Queries the number from MySQL if enabled in prefs and result is limited, otherwise just return the fullResult count.
*/
@@ -1676,6 +1676,9 @@
numRows = [fullResult count];
}
+ // Update table data cache with the more accurate row count
+ [tableDataInstance setStatusValue:[NSString stringWithFormat:@"%d", numRows] forKey:@"Rows"];
+
return numRows;
}
@@ -1687,15 +1690,13 @@
return [[[[mySQLConnection queryString:[NSString stringWithFormat:@"SELECT COUNT(1) FROM %@", [selectedTable backtickQuotedString]]] fetchRowAsArray] objectAtIndex:0] intValue];
}
-//tableView datasource methods
+// TableView datasource methods
- (int)numberOfRowsInTableView:(NSTableView *)aTableView
{
return [filteredResult count];
}
-- (id)tableView:(CMCopyTable *)aTableView
-objectValueForTableColumn:(NSTableColumn *)aTableColumn
- row:(int)rowIndex
+- (id)tableView:(CMCopyTable *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
{
id theValue = NSArrayObjectAtIndex(NSArrayObjectAtIndex(filteredResult, rowIndex), [[aTableColumn identifier] intValue]);
@@ -1706,14 +1707,13 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn
return theValue;
}
+/**
+ * This function changes the text color of text/blob fields which are not yet loaded to gray
+ */
- (void)tableView: (CMCopyTable *)aTableView
willDisplayCell: (id)cell
forTableColumn: (NSTableColumn*)aTableColumn
row: (int)row
-/*
- * This function changes the text color of
- * text/blob fields which are not yet loaded to gray
-*/
{
// Check if loading of text/blob fields is disabled
// If not, all text fields are loaded and we don't have to make them gray