aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/SPQueryController.m10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/SPQueryController.m b/Source/SPQueryController.m
index 3a3a2982..25b972bb 100644
--- a/Source/SPQueryController.m
+++ b/Source/SPQueryController.m
@@ -172,11 +172,15 @@ static SPQueryController *sharedQueryController = nil;
if ((firstResponder == consoleTableView) && ([consoleTableView numberOfSelectedRows] > 0)) {
- NSString *string = @"";
+ NSMutableString *string = [NSMutableString string];
NSIndexSet *rows = [consoleTableView selectedRowIndexes];
NSUInteger i = [rows firstIndex];
+ BOOL dateColumnIsHidden = [[consoleTableView tableColumnWithIdentifier:TABLEVIEW_DATE_COLUMN_IDENTIFIER] isHidden];
+
+ [string setString:@""];
+
while (i != NSNotFound)
{
if (i < [messagesVisibleSet count]) {
@@ -185,14 +189,14 @@ static SPQueryController *sharedQueryController = nil;
NSString *consoleMessage = [message message];
// If the timestamp column is not hidden we need to include them in the copy
- if (![[consoleTableView tableColumnWithIdentifier:TABLEVIEW_DATE_COLUMN_IDENTIFIER] isHidden]) {
+ if (!dateColumnIsHidden) {
NSString *dateString = [[message messageDate] descriptionWithCalendarFormat:MESSAGE_TIME_STAMP_FORMAT timeZone:nil locale:nil];
consoleMessage = [NSString stringWithFormat:@"/* MySQL %@ */ %@", dateString, consoleMessage];
}
- string = [string stringByAppendingFormat:@"%@\n", consoleMessage];
+ [string appendFormat:@"%@\n", consoleMessage];
}
i = [rows indexGreaterThanIndex:i];