Changeset 4983
- Timestamp:
- 10/20/07 02:43:50 (9 months ago)
- Files:
-
- Footagehead/trunk/FHSpotlightHandler.m (modified) (3 diffs)
- Footagehead/trunk/Footagehead.xcodeproj/project.pbxproj (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Footagehead/trunk/FHSpotlightHandler.m
r4726 r4983 30 30 #import "FHSpotlightHandler.h" 31 31 32 @interface FHSpotlightHandler(Private) 33 34 - (void)_addFilesFromQuery; 35 36 @end 37 38 39 @implementation FHSpotlightHandler(Private) 40 41 - (void)_addFilesFromQuery { 42 NSMetadataItem *item; 43 NSString *path; 44 NSUInteger count; 45 46 count = [_query resultCount]; 47 48 for(; _index < count; _index++) { 49 item = [_query resultAtIndex:_index]; 50 path = [item valueForAttribute:@"kMDItemPath"]; 51 52 if(path) { 53 [_files addObject:[FHFile fileWithURL:[WIURL fileURLWithPath:path] isDirectory:NO]]; 54 55 _numberOfFiles++; 56 _numberOfImages++; 57 58 [_delegate handlerDidAddFiles:self]; 59 } 60 } 61 } 62 63 @end 64 65 66 32 67 @implementation FHSpotlightHandler 33 68 … … 45 80 _query = [[NSMetadataQuery alloc] init]; 46 81 [_query setPredicate:[NSPredicate predicateWithFormat: 47 @"(kMDItemFSName LIKE[cd] %@) && (kMDItemContentTypeTree == \"public.image\")",48 [[url path] substringFromIndex:1]]];49 82 [NSSWF:@"(kMDItemDisplayName LIKE[cd] '*%@*') && (kMDItemContentTypeTree == \"public.image\")", 83 [[url path] substringFromIndex:1]]]]; 84 50 85 [[NSNotificationCenter defaultCenter] 51 86 addObserver:self 52 87 selector:@selector(metadataQueryGatheringProgress:) 53 88 name:NSMetadataQueryGatheringProgressNotification]; 89 90 [[NSNotificationCenter defaultCenter] 91 addObserver:self 92 selector:@selector(metadataQueryDidUpdate:) 93 name:NSMetadataQueryDidUpdateNotification]; 54 94 55 95 [[NSNotificationCenter defaultCenter] … … 76 116 77 117 - (void)metadataQueryGatheringProgress:(NSNotification *)notification { 78 NSMetadataItem *item; 79 NSString *path; 80 NSUInteger count; 81 82 count = [_query resultCount]; 83 84 for(; _index < count; _index++) { 85 item = [_query resultAtIndex:_index]; 86 path = [item valueForAttribute:@"kMDItemPath"]; 87 88 if(path) { 89 [_files addObject:[FHFile fileWithURL:[WIURL fileURLWithPath:path] isDirectory:NO]]; 90 91 _numberOfFiles++; 92 _numberOfImages++; 93 94 [_delegate handlerDidAddFiles:self]; 95 } 96 } 118 [self _addFilesFromQuery]; 97 119 } 98 120 121 122 123 - (void)metadataQueryDidUpdate:(NSNotification *)notification { 124 [self _addFilesFromQuery]; 125 } 126 99 127 100 128 Footagehead/trunk/Footagehead.xcodeproj/project.pbxproj
r4981 r4983 178 178 containerPortal = 77396B390857A18300058AF5 /* WiredAdditions.xcodeproj */; 179 179 proxyType = 2; 180 remoteGlobalIDString = 774897900CC8A63200E95A83 /* WiredNetworking.framework */;180 remoteGlobalIDString = 774897900CC8A63200E95A83; 181 181 remoteInfo = "Wired Networking"; 182 182 };
