adium 4680:bb8f087a0860: If the logArray is nil, then we're stil...
commits at adium.im
commits at adium.im
Fri Feb 10 23:51:45 UTC 2012
details: http://hg.adium.im/adium/rev/bb8f087a0860
revision: 4680:bb8f087a0860
branch: (none)
author: Thijs Alkemade <thijsalkemade at gmail.com>
date: Sat Feb 11 00:48:52 2012 +0100
If the logArray is nil, then we're still indexing, so show "Loading...", if the logArray is an empty array, the user has not selected anything, so show nothing.
This should stop the text "Loading..." from flashing while indexing.
Subject: adium 4681:e30c939bb5dc: Don't flush inside this lock. The lock is acquired on the main thread to cancel a search, and flushing can take a looong time.
details: http://hg.adium.im/adium/rev/e30c939bb5dc
revision: 4681:e30c939bb5dc
branch: (none)
author: Thijs Alkemade <thijsalkemade at gmail.com>
date: Sat Feb 11 00:51:32 2012 +0100
Don't flush inside this lock. The lock is acquired on the main thread to cancel a search, and flushing can take a looong time.
diffs (40 lines):
diff -r fceff51f0ad7 -r e30c939bb5dc Source/AILogViewerWindowController.m
--- a/Source/AILogViewerWindowController.m Sat Feb 11 00:04:26 2012 +0100
+++ b/Source/AILogViewerWindowController.m Sat Feb 11 00:51:32 2012 +0100
@@ -709,10 +709,14 @@
{
[displayOperation cancel];
[displayOperation autorelease];
+ displayOperation = nil;
currentMatch = -1;
[self _displayLogText:[NSAttributedString stringWithString:@"Loading..."]];
- displayOperation = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(_displayLogs:) object:logArray];
- [[[self class] sharedLogViewerQueue] addOperation:displayOperation];
+
+ if (logArray) {
+ displayOperation = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(_displayLogs:) object:logArray];
+ [[[self class] sharedLogViewerQueue] addOperation:displayOperation];
+ }
}
//Displays the contents of the specified log in our window
@@ -1571,15 +1575,16 @@
[wildcardedSearchString appendFormat:@"%@ ", searchComponent];
}
- AILogWithSignature(@"Calling flush");
- SKIndexFlush(logSearchIndex);
- AILogWithSignature(@"Done flushing. Now we can search.");
thisSearch = SKSearchCreate(logSearchIndex,
(CFStringRef)wildcardedSearchString,
kSKSearchOptionDefault);
currentSearch = (thisSearch ? (SKSearchRef)CFRetain(thisSearch) : NULL);
[currentSearchLock unlock];
+ AILogWithSignature(@"Calling flush");
+ SKIndexFlush(logSearchIndex);
+ AILogWithSignature(@"Done flushing. Now we can search.");
+
//Retrieve matches as long as more are pending
while (more && currentSearch) {
#define BATCH_NUMBER 100
More information about the commits
mailing list