aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-10-15 14:48:41 +0000
committerBibiko <bibiko@eva.mpg.de>2009-10-15 14:48:41 +0000
commitfd16fc8212a706ab6de53863862b5bb28ddc5c71 (patch)
tree9d9857f7047987dc3452749c21b9b0960d817fd2
parent7e023c253e72c9a27bba0728160fbb8aaf19ffd1 (diff)
downloadsequelpro-fd16fc8212a706ab6de53863862b5bb28ddc5c71.tar.gz
sequelpro-fd16fc8212a706ab6de53863862b5bb28ddc5c71.tar.bz2
sequelpro-fd16fc8212a706ab6de53863862b5bb28ddc5c71.zip
• fixed issue while copying a very large number queries from the Console Log window
- make usage of a NSMutableString to speed it up and to avoid crashes
-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];