aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPAppController.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2011-01-03 22:58:07 +0000
committerrowanbeentje <rowan@beent.je>2011-01-03 22:58:07 +0000
commite85f7dfdc240b9e5be2ff4cbe46727f49096f91f (patch)
tree7049a3cebfbe513fbd78fedda338f5e8d2acce70 /Source/SPAppController.m
parentf7874daaeb147cda239b69330a7819aba5bb3bbc (diff)
downloadsequelpro-e85f7dfdc240b9e5be2ff4cbe46727f49096f91f.tar.gz
sequelpro-e85f7dfdc240b9e5be2ff4cbe46727f49096f91f.tar.bz2
sequelpro-e85f7dfdc240b9e5be2ff4cbe46727f49096f91f.zip
- 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
Diffstat (limited to 'Source/SPAppController.m')
-rw-r--r--Source/SPAppController.m9
1 files changed, 5 insertions, 4 deletions
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];