From 1d7ed99d602bf9c7aa4ea40a9a2ab6458864e51f Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Sun, 22 Jan 2012 12:19:21 +0000 Subject: Bring outlinew view branch up to date with trunk (r3375:3468). --- Source/SPProcessListController.m | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'Source/SPProcessListController.m') 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 -- cgit v1.2.3