From b54a768bc63b01475a79426ea519d22217a001c5 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Thu, 18 Jun 2009 08:18:33 +0000 Subject: =?UTF-8?q?=E2=80=A2=20some=20tiny=20improvements=20to=20speed=20u?= =?UTF-8?q?p=20queryString:=20-=20cache=20the=20function=20pointer=20for?= =?UTF-8?q?=20delegate=20willPerformQuery:=20-=20if=20Console=20Log=20wind?= =?UTF-8?q?ow=20is=20NOT=20visible=20suppress=20reloadData=20and=20scrolli?= =?UTF-8?q?ng=20to=20last=20line=20(this=20speeds=20it=20up=20remarkably);?= =?UTF-8?q?=20if=20user=20opens=20the=20Console=20log=20window=20it=20will?= =?UTF-8?q?=20be=20synchronized=20-=20timeIntervall=20for=20execution=20ti?= =?UTF-8?q?me=20will=20be=20divide=20by=20CLOCKS=5FPER=5FSEC=20in=20[NSStr?= =?UTF-8?q?ing=20stringForTimeInterval]=20-=20removed=20for=20utf8=20enc?= =?UTF-8?q?=20in=20cString=20the=20return=20UTF8String=20(no=20significant?= =?UTF-8?q?=20difference)=20=E2=80=A2=20now=20execution=20time=20shows=20o?= =?UTF-8?q?nly=20the=20time=20for=20mysql=5Freal=5Fquery?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPQueryConsole.m | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'Source/SPQueryConsole.m') diff --git a/Source/SPQueryConsole.m b/Source/SPQueryConsole.m index a7c7263d..dab9a9a0 100644 --- a/Source/SPQueryConsole.m +++ b/Source/SPQueryConsole.m @@ -365,6 +365,12 @@ static SPQueryConsole *sharedQueryConsole = nil; return [[self window] validateMenuItem:menuItem]; } +- (void)updateEntries +{ + [consoleTableView reloadData]; + [consoleTableView scrollRowToVisible:([messagesVisibleSet count] - 1)]; +} + /** * Standard dealloc. */ @@ -494,9 +500,11 @@ static SPQueryConsole *sharedQueryConsole = nil; [clearConsoleButton setEnabled:YES]; } - // Reload the table and scroll to the new message - [consoleTableView reloadData]; - [consoleTableView scrollRowToVisible:([messagesVisibleSet count] - 1)]; + // Reload the table and scroll to the new message if it's visible (for speed) + if ( [[self window] isVisible] ) { + [consoleTableView reloadData]; + [consoleTableView scrollRowToVisible:([messagesVisibleSet count] - 1)]; + } } /** -- cgit v1.2.3