aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPProcessListController.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-01-22 12:19:21 +0000
committerstuconnolly <stuart02@gmail.com>2012-01-22 12:19:21 +0000
commit1d7ed99d602bf9c7aa4ea40a9a2ab6458864e51f (patch)
tree6c08ad29618ea02caf302180706d010c90cd57e0 /Source/SPProcessListController.m
parente23ba5155a53c43a106ac9646f51321ccc7d86f4 (diff)
downloadsequelpro-1d7ed99d602bf9c7aa4ea40a9a2ab6458864e51f.tar.gz
sequelpro-1d7ed99d602bf9c7aa4ea40a9a2ab6458864e51f.tar.bz2
sequelpro-1d7ed99d602bf9c7aa4ea40a9a2ab6458864e51f.zip
Bring outlinew view branch up to date with trunk (r3375:3468).
Diffstat (limited to 'Source/SPProcessListController.m')
-rw-r--r--Source/SPProcessListController.m25
1 files changed, 23 insertions, 2 deletions
diff --git a/Source/SPProcessListController.m b/Source/SPProcessListController.m
index b0242a35..4f0490cb 100644
--- a/Source/SPProcessListController.m
+++ b/Source/SPProcessListController.m
@@ -80,7 +80,7 @@ static NSString *SPTableViewIDColumnIdentifier = @"Id";
*/
- (void)awakeFromNib
{
- [[self window] setTitle:[NSString stringWithFormat:@"%@ %@", [[(SPAppController*)[NSApp delegate] frontDocument] name], NSLocalizedString(@"Server Processes", @"server processes window title")]];
+ [[self window] setTitle:[NSString stringWithFormat:NSLocalizedString(@"Server Processes on %@", @"server processes window title (var = hostname)"),[[(SPAppController*)[NSApp delegate] frontDocument] name]]];
[self setWindowFrameAutosaveName:@"ProcessList"];
@@ -700,8 +700,29 @@ static NSString *SPTableViewIDColumnIdentifier = @"Id";
for (i = 0; i < [processList numOfRows]; i++)
{
- [processes addObject:[processList fetchRowAsDictionary]];
+ //MCPKit currently returns numbers as NSString, which will break sorting of numbers in this case.
+ NSMutableDictionary *rowsFixed = [[processList fetchRowAsDictionary] mutableCopy];
+
+ id idColumn = [rowsFixed objectForKey:@"Id"];
+ //Id is a signed int(11) - this is a signed 32 bit int value
+ if(idColumn != nil && [idColumn isKindOfClass:[NSString class]]) {
+ int numRaw = [(NSString *)idColumn intValue];
+ NSNumber *num = [NSNumber numberWithInt:numRaw];
+ [rowsFixed setObject:num forKey:@"Id"];
+ }
+
+ id timeColumn = [rowsFixed objectForKey:@"Time"];
+ //Time is a signed int(7) - this is the same 32 bit int value
+ if(timeColumn != nil && [timeColumn isKindOfClass:[NSString class]]) {
+ int numRaw = [(NSString *)timeColumn intValue];
+ NSNumber *num = [NSNumber numberWithInt:numRaw];
+ [rowsFixed setObject:num forKey:@"Time"];
+ }
+
+ [processes addObject:[[rowsFixed copy] autorelease]];
+ [rowsFixed release];
}
+
}
// Update the UI on the main thread