--- a/Other/Adium Spotlight Importer/GetMetadataForFile.m Mon Jun 25 02:10:25 2012 +0200
+++ b/Other/Adium Spotlight Importer/GetMetadataForFile.m Mon Jun 25 02:57:36 2012 +0200
@@ -307,11 +307,29 @@
NSString *CopyTextContentForXMLLogData(NSData *data) {
NSString *contentString = nil;
- NSXMLDocument *xmlDoc = [[NSXMLDocument alloc] initWithData:data options:NSXMLNodePreserveCDATA error:NULL];
+ NSXMLDocument *xmlDoc = [[NSXMLDocument alloc] initWithData:data options:NSXMLNodePreserveCDATA error:&err]; - NSArray *contentArray = [xmlDoc nodesForXPath:@"//message//text()" error:NULL];
- contentString = [contentArray componentsJoinedByString:@" "];
+ NSArray *children = [[xmlDoc rootElement] children]; + NSMutableArray *messages = [NSMutableArray array]; + for (NSXMLNode *child in children) { + if ([child.name isEqualToString:@"message"]) { + [messages addObject:child.stringValue]; + if (messages.count) contentString = [messages componentsJoinedByString:@" "];
+#ifdef AILogWithSignature + AILogWithSignature(@"Parsing log failed: %@", err); + [contentString retain]; --- a/Source/AILoggerPlugin.m Mon Jun 25 02:10:25 2012 +0200
+++ b/Source/AILoggerPlugin.m Mon Jun 25 02:57:36 2012 +0200
@@ -1494,20 +1494,20 @@
* 3. On 10.3, this means that logs' markup is indexed in addition to their text, which is undesireable.
- NSData *documentData = [CopyDataForURL(NULL, logURL) autorelease];
+ NSData *documentData = CopyDataForURL(NULL, logURL); dispatch_semaphore_wait(jobSemaphore, DISPATCH_TIME_FOREVER);
dispatch_group_async(logIndexingGroup, defaultDispatchQueue, blockWithAutoreleasePool(^{
__block CFStringRef documentText = CopyTextContentForFileData(NULL, logURL, documentData);
- if (documentText) CFRetain(documentText);
+ [documentData release]; dispatch_group_async(logIndexingGroup, defaultDispatchQueue, blockWithAutoreleasePool(^{
- if (documentText && bself.indexingAllowed) {
+ if (documentText && CFStringGetLength(documentText) > 0 && bself.indexingAllowed) { static dispatch_queue_t skQueue = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{