Skip to content

Commit

Permalink
updated project settings, added non-attribution option, fixed atomic/…
Browse files Browse the repository at this point in the history
…synthesized warnings for three properties
  • Loading branch information
Philip Dow committed Dec 6, 2011
1 parent 8932320 commit 272d9ad
Show file tree
Hide file tree
Showing 14 changed files with 138 additions and 108 deletions.
6 changes: 3 additions & 3 deletions SPSearchStore.h
Expand Up @@ -33,9 +33,9 @@
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */


// Basically, you can use the code in your free, commercial, private and public projects /*
// as long as you include the above notice and attribute the code to Philip Dow / Sprouted For non-attribution licensing options refer to http://phildow.net/licensing/
// If you use this code in an app send me a note. I'd love to know how the code is used. */


#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import <CoreServices/CoreServices.h> #import <CoreServices/CoreServices.h>
Expand Down
75 changes: 52 additions & 23 deletions SPSearchStore.m
Expand Up @@ -33,9 +33,9 @@
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */


// Basically, you can use the code in your free, commercial, private and public projects /*
// as long as you include the above notice and attribute the code to Philip Dow / Sprouted For non-attribution licensing options refer to http://phildow.net/licensing/
// If you use this code in an app send me a note. I'd love to know how the code is used. */


#import "SPSearchStore.h" #import "SPSearchStore.h"


Expand Down Expand Up @@ -118,7 +118,6 @@ - (BOOL) _compactIndex;
@implementation SPSearchStore @implementation SPSearchStore


@synthesize searchIndex; @synthesize searchIndex;
@synthesize storeData;
@synthesize storeURL; @synthesize storeURL;


@synthesize writeLock; @synthesize writeLock;
Expand All @@ -128,8 +127,6 @@ @implementation SPSearchStore
@synthesize analysisOptions; @synthesize analysisOptions;
@synthesize stopWords; @synthesize stopWords;


@synthesize usesSpotlightImporters;
@synthesize usesConcurrentIndexing;
@synthesize ignoresNumericTerms; @synthesize ignoresNumericTerms;


@synthesize fetchCount; @synthesize fetchCount;
Expand Down Expand Up @@ -254,29 +251,61 @@ - (void) dealloc {
#pragma mark - #pragma mark -


- (void) setUsesSpotlightImporters:(BOOL)useSpotlight { - (void) setUsesSpotlightImporters:(BOOL)useSpotlight {
usesSpotlightImporters = useSpotlight; @synchronized(self) {
usesSpotlightImporters = useSpotlight;

if ( useSpotlight ) SKLoadDefaultExtractorPlugIns();
}
}


if ( useSpotlight ) SKLoadDefaultExtractorPlugIns(); - (BOOL) usesSpotlightImporters {
BOOL uses;
@synchronized(self) {
uses = usesSpotlightImporters;
}
return uses;
} }


- (void) setUsesConcurrentIndexing:(BOOL)useConcurrent { - (void) setUsesConcurrentIndexing:(BOOL)useConcurrent {
usesConcurrentIndexing = useConcurrent; @synchronized(self) {

usesConcurrentIndexing = useConcurrent;
if ( useConcurrent && indexQue == nil ) {
indexQue = [[NSOperationQueue alloc] init]; if ( useConcurrent && indexQue == nil ) {
[indexQue setMaxConcurrentOperationCount:1]; indexQue = [[NSOperationQueue alloc] init];
// we lock around calls to the index, so there is no point [indexQue setMaxConcurrentOperationCount:1];
// in supporting more than one operation simultaneously // we lock around calls to the index, so there is no point
} // in supporting more than one operation simultaneously
else if ( !useConcurrent && indexQue != nil ) { }
[indexQue cancelAllOperations]; else if ( !useConcurrent && indexQue != nil ) {
[indexQue release], indexQue = nil; [indexQue cancelAllOperations];
} [indexQue release], indexQue = nil;
}
}
}

- (BOOL) usesConcurrentIndexing {
BOOL uses;
@synchronized(self) {
uses = usesConcurrentIndexing;
}
return uses;
}

- (void) setStoreData:(NSMutableData *)inData {
@synchronized(self) {
[inData retain];
[storeData release];
storeData = inData;
}
} }


- (NSMutableData *) storeData { - (NSMutableData *) storeData {
[self _flushIndexIfNecessary]; NSMutableData *data = nil;
return storeData; @synchronized(self) {
[self _flushIndexIfNecessary];
data = [[storeData retain] autorelease];
}
return data;
} }


#pragma mark - #pragma mark -
Expand Down Expand Up @@ -940,7 +969,7 @@ - (NSArray*) allTerms {


CFStringRef aTerm = SKIndexCopyTermStringForTermID( searchIndex, aTermID ); CFStringRef aTerm = SKIndexCopyTermStringForTermID( searchIndex, aTermID );
if ( aTerm == NULL ) { if ( aTerm == NULL ) {
NSLog(@"%s - unable to get term for term index %i", __PRETTY_FUNCTION__, aTermID); NSLog(@"%s - unable to get term for term index %ld", __PRETTY_FUNCTION__, aTermID);
continue; continue;
} }


Expand Down
53 changes: 27 additions & 26 deletions SPSearchStore.xcodeproj/philipdow.mode1v3
Expand Up @@ -274,7 +274,7 @@
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key> <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array> <array>
<array> <array>
<integer>5</integer> <integer>4</integer>
<integer>2</integer> <integer>2</integer>
<integer>0</integer> <integer>0</integer>
</array> </array>
Expand Down Expand Up @@ -317,28 +317,28 @@
<key>PBXProjectModuleGUID</key> <key>PBXProjectModuleGUID</key>
<string>1CE0B20306471E060097A5F4</string> <string>1CE0B20306471E060097A5F4</string>
<key>PBXProjectModuleLabel</key> <key>PBXProjectModuleLabel</key>
<string>SPSearchStore.h</string> <string>SPSearchStoreAppDelegate.m</string>
<key>PBXSplitModuleInNavigatorKey</key> <key>PBXSplitModuleInNavigatorKey</key>
<dict> <dict>
<key>Split0</key> <key>Split0</key>
<dict> <dict>
<key>PBXProjectModuleGUID</key> <key>PBXProjectModuleGUID</key>
<string>1CE0B20406471E060097A5F4</string> <string>1CE0B20406471E060097A5F4</string>
<key>PBXProjectModuleLabel</key> <key>PBXProjectModuleLabel</key>
<string>SPSearchStore.h</string> <string>SPSearchStoreAppDelegate.m</string>
<key>_historyCapacity</key> <key>_historyCapacity</key>
<integer>0</integer> <integer>0</integer>
<key>bookmark</key> <key>bookmark</key>
<string>729EA421146AF8DB005C9273</string> <string>72CD85EC148D501500A6CCF2</string>
<key>history</key> <key>history</key>
<array> <array>
<string>72F4C6B5139FED21008B8E9D</string> <string>72F4C6B5139FED21008B8E9D</string>
<string>72F4C739139FF650008B8E9D</string> <string>72F4C739139FF650008B8E9D</string>
<string>72F4C74E139FFA3B008B8E9D</string> <string>72F4C74E139FFA3B008B8E9D</string>
<string>72F4C7DF13A02B88008B8E9D</string>
<string>72F4C7E113A02B88008B8E9D</string> <string>72F4C7E113A02B88008B8E9D</string>
<string>72920A7F13A1BBD6001C4D52</string> <string>72CD85E8148D3AB200A6CCF2</string>
<string>72CAE2921469EACA004CBFE3</string> <string>72CD85E9148D3AB200A6CCF2</string>
<string>72CD85EA148D3AB200A6CCF2</string>
</array> </array>
</dict> </dict>
<key>SplitCount</key> <key>SplitCount</key>
Expand All @@ -350,14 +350,14 @@
<key>GeometryConfiguration</key> <key>GeometryConfiguration</key>
<dict> <dict>
<key>Frame</key> <key>Frame</key>
<string>{{0, 0}, {905, 431}}</string> <string>{{0, 0}, {905, 417}}</string>
<key>RubberWindowFrame</key> <key>RubberWindowFrame</key>
<string>66 82 1178 676 0 0 1280 778 </string> <string>66 82 1178 676 0 0 1280 778 </string>
</dict> </dict>
<key>Module</key> <key>Module</key>
<string>PBXNavigatorGroup</string> <string>PBXNavigatorGroup</string>
<key>Proportion</key> <key>Proportion</key>
<string>431pt</string> <string>417pt</string>
</dict> </dict>
<dict> <dict>
<key>ContentConfiguration</key> <key>ContentConfiguration</key>
Expand All @@ -370,14 +370,14 @@
<key>GeometryConfiguration</key> <key>GeometryConfiguration</key>
<dict> <dict>
<key>Frame</key> <key>Frame</key>
<string>{{0, 436}, {905, 199}}</string> <string>{{0, 422}, {905, 213}}</string>
<key>RubberWindowFrame</key> <key>RubberWindowFrame</key>
<string>66 82 1178 676 0 0 1280 778 </string> <string>66 82 1178 676 0 0 1280 778 </string>
</dict> </dict>
<key>Module</key> <key>Module</key>
<string>XCDetailModule</string> <string>XCDetailModule</string>
<key>Proportion</key> <key>Proportion</key>
<string>199pt</string> <string>213pt</string>
</dict> </dict>
</array> </array>
<key>Proportion</key> <key>Proportion</key>
Expand All @@ -396,9 +396,9 @@
</array> </array>
<key>TableOfContents</key> <key>TableOfContents</key>
<array> <array>
<string>729EA422146AF8DB005C9273</string> <string>72CD85DF148D2C2F00A6CCF2</string>
<string>1CE0B1FE06471DED0097A5F4</string> <string>1CE0B1FE06471DED0097A5F4</string>
<string>729EA423146AF8DB005C9273</string> <string>72CD85E0148D2C2F00A6CCF2</string>
<string>1CE0B20306471E060097A5F4</string> <string>1CE0B20306471E060097A5F4</string>
<string>1CE0B20506471E060097A5F4</string> <string>1CE0B20506471E060097A5F4</string>
</array> </array>
Expand Down Expand Up @@ -536,6 +536,7 @@
<integer>5</integer> <integer>5</integer>
<key>WindowOrderList</key> <key>WindowOrderList</key>
<array> <array>
<string>1CD10A99069EF8BA00B06720</string>
<string>72F4BBCC139D2AB0008B8E9D</string> <string>72F4BBCC139D2AB0008B8E9D</string>
<string>/Users/philipdow/Projects/~Shared Code/SPSearchStore/SPSearchStore.xcodeproj</string> <string>/Users/philipdow/Projects/~Shared Code/SPSearchStore/SPSearchStore.xcodeproj</string>
</array> </array>
Expand Down Expand Up @@ -617,7 +618,7 @@
<key>TableOfContents</key> <key>TableOfContents</key>
<array> <array>
<string>72F4BBCC139D2AB0008B8E9D</string> <string>72F4BBCC139D2AB0008B8E9D</string>
<string>729EA424146AF8DB005C9273</string> <string>72CD85E1148D2C2F00A6CCF2</string>
<string>1CD0528F0623707200166675</string> <string>1CD0528F0623707200166675</string>
<string>XCMainBuildResultsModuleGUID</string> <string>XCMainBuildResultsModuleGUID</string>
</array> </array>
Expand Down Expand Up @@ -661,8 +662,8 @@
<string>yes</string> <string>yes</string>
<key>sizes</key> <key>sizes</key>
<array> <array>
<string>{{0, 0}, {475, 269}}</string> <string>{{0, 0}, {476, 288}}</string>
<string>{{475, 0}, {568, 269}}</string> <string>{{476, 0}, {567, 288}}</string>
</array> </array>
</dict> </dict>
<key>VerticalSplitView</key> <key>VerticalSplitView</key>
Expand All @@ -677,8 +678,8 @@
<string>yes</string> <string>yes</string>
<key>sizes</key> <key>sizes</key>
<array> <array>
<string>{{0, 0}, {1043, 269}}</string> <string>{{0, 0}, {1043, 288}}</string>
<string>{{0, 269}, {1043, 286}}</string> <string>{{0, 288}, {1043, 267}}</string>
</array> </array>
</dict> </dict>
</dict> </dict>
Expand Down Expand Up @@ -708,10 +709,10 @@
<string>Value</string> <string>Value</string>
<real>132</real> <real>132</real>
<string>Summary</string> <string>Summary</string>
<real>206</real> <real>205</real>
</array> </array>
<key>Frame</key> <key>Frame</key>
<string>{{475, 0}, {568, 269}}</string> <string>{{476, 0}, {567, 288}}</string>
<key>RubberWindowFrame</key> <key>RubberWindowFrame</key>
<string>159 143 1043 596 0 0 1280 778 </string> <string>159 143 1043 596 0 0 1280 778 </string>
</dict> </dict>
Expand Down Expand Up @@ -739,13 +740,13 @@
<key>TableOfContents</key> <key>TableOfContents</key>
<array> <array>
<string>1CD10A99069EF8BA00B06720</string> <string>1CD10A99069EF8BA00B06720</string>
<string>72F4BC99139D447D008B8E9D</string> <string>72CD85E2148D2C2F00A6CCF2</string>
<string>1C162984064C10D400B95A72</string> <string>1C162984064C10D400B95A72</string>
<string>72F4BC9A139D447D008B8E9D</string> <string>72CD85E3148D2C2F00A6CCF2</string>
<string>72F4BC9B139D447D008B8E9D</string> <string>72CD85E4148D2C2F00A6CCF2</string>
<string>72F4BC9C139D447D008B8E9D</string> <string>72CD85E5148D2C2F00A6CCF2</string>
<string>72F4BC9D139D447D008B8E9D</string> <string>72CD85E6148D2C2F00A6CCF2</string>
<string>72F4BC9E139D447D008B8E9D</string> <string>72CD85E7148D2C2F00A6CCF2</string>
</array> </array>
<key>ToolbarConfiguration</key> <key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.debugV3</string> <string>xcode.toolbar.config.debugV3</string>
Expand Down

0 comments on commit 272d9ad

Please sign in to comment.