From 7e023c253e72c9a27bba0728160fbb8aaf19ffd1 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Thu, 15 Oct 2009 13:45:35 +0000 Subject: =?UTF-8?q?=E2=80=A2=20added=20the=20chance=20to=20set=20"allowCon?= =?UTF-8?q?soleUpdate"=20-=20if=20set=20to=20YES=20the=20Console=20Log=20w?= =?UTF-8?q?on't=20be=20updated=20after=20adding=20a=20new=20message=20even?= =?UTF-8?q?=20if=20the=20window=20is=20visible;=20this=20is=20useful=20if?= =?UTF-8?q?=20SP=20has=20to=20execute=20a=20large=20number=20of=20queries?= =?UTF-8?q?=20=E2=80=A2=20first=20steps=20to=20increase=20the=20deletion?= =?UTF-8?q?=20of=20a=20large=20number=20of=20rows=20in=20the=20Content=20p?= =?UTF-8?q?ane=20-=20removed=20deprecated=20'selectedRowEnumerator'=20-=20?= =?UTF-8?q?set=20Console=20Log's=20'allowConsoleUpdate'=20to=20NO=20if=20m?= =?UTF-8?q?ore=20than=2010=20rows=20should=20be=20deleted=20-=20instead=20?= =?UTF-8?q?of=20adding=20the=20successful=20deleted=20row=20indexes=20into?= =?UTF-8?q?=20a=20new=20array=20delete=20these=20indexes=20from=20the=20se?= =?UTF-8?q?lectedRows=20NSIndexSet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPQueryController.m | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'Source/SPQueryController.m') diff --git a/Source/SPQueryController.m b/Source/SPQueryController.m index 86fa9908..3a3a2982 100644 --- a/Source/SPQueryController.m +++ b/Source/SPQueryController.m @@ -54,32 +54,33 @@ static SPQueryController *sharedQueryController = nil; @implementation SPQueryController @synthesize consoleFont; +@synthesize allowConsoleUpdate; /* * Returns the shared query console. */ + (SPQueryController *)sharedQueryController { - @synchronized(self) { - if (sharedQueryController == nil) { - [[self alloc] init]; - } - } - - return sharedQueryController; + @synchronized(self) { + if (sharedQueryController == nil) { + [[self alloc] init]; + } + } + + return sharedQueryController; } + (id)allocWithZone:(NSZone *)zone { - @synchronized(self) { - if (sharedQueryController == nil) { - sharedQueryController = [super allocWithZone:zone]; - - return sharedQueryController; - } - } - - return nil; // On subsequent allocation attempts return nil + @synchronized(self) { + if (sharedQueryController == nil) { + sharedQueryController = [super allocWithZone:zone]; + + return sharedQueryController; + } + } + + return nil; // On subsequent allocation attempts return nil } - (id)init @@ -98,6 +99,7 @@ static SPQueryController *sharedQueryController = nil; untitledDocumentCounter = 1; numberOfMaxAllowedHistory = 100; + allowConsoleUpdate = YES; favoritesContainer = [[NSMutableDictionary alloc] init]; historyContainer = [[NSMutableDictionary alloc] init]; @@ -757,7 +759,7 @@ static SPQueryController *sharedQueryController = nil; } // Reload the table and scroll to the new message if it's visible (for speed) - if ( [[self window] isVisible] ) { + if ( allowConsoleUpdate && [[self window] isVisible] ) { [consoleTableView reloadData]; [consoleTableView scrollRowToVisible:([messagesVisibleSet count] - 1)]; } -- cgit v1.2.3