From e85f7dfdc240b9e5be2ff4cbe46727f49096f91f Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Mon, 3 Jan 2011 22:58:07 +0000 Subject: - Alter bundle search paths to no longer add a blank location as the first option if the Application support bundles folder does not exist; addresses issues where default bundles are updated in the hard disk root --- Source/SPAppController.m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Source') diff --git a/Source/SPAppController.m b/Source/SPAppController.m index f13a43f6..99f950a1 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -1346,10 +1346,11 @@ // Clean menu [menu compatibleRemoveAllItems]; - NSArray *bundlePaths = [NSArray arrayWithObjects: - ([[NSFileManager defaultManager] applicationSupportDirectoryForSubDirectory:SPBundleSupportFolder createIfNotExists:NO error:nil])?:@"", - [NSString stringWithFormat:@"%@/Contents/SharedSupport/Default Bundles", [[NSBundle mainBundle] bundlePath]], - nil]; + // Set up the bundle search paths - always the default bundles directory, and the application support directory if it exists + NSMutableArray *bundlePaths = [NSMutableArray arrayWithCapacity:2]; + NSString *appSupportPath = [[NSFileManager defaultManager] applicationSupportDirectoryForSubDirectory:SPBundleSupportFolder createIfNotExists:NO error:nil]; + if (appSupportPath) [bundlePaths addObject:appSupportPath]; + [bundlePaths addObject:[NSString stringWithFormat:@"%@/Contents/SharedSupport/Default Bundles", [[NSBundle mainBundle] bundlePath]]]; BOOL processDefaultBundles = NO; NSFileManager *fm = [NSFileManager defaultManager]; -- cgit v1.2.3