aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPAppController.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-12-22 05:08:12 +0000
committerBibiko <bibiko@eva.mpg.de>2010-12-22 05:08:12 +0000
commit7c0e19ddea57a362e9ec6bbc22a2b57b97a758f4 (patch)
tree2131eb270ad7f4e0fe582b4a57b7dce451ce4686 /Source/SPAppController.m
parent55fb563d473c25c0ea917898001b7ab4c4e09633 (diff)
downloadsequelpro-7c0e19ddea57a362e9ec6bbc22a2b57b97a758f4.tar.gz
sequelpro-7c0e19ddea57a362e9ec6bbc22a2b57b97a758f4.tar.bz2
sequelpro-7c0e19ddea57a362e9ec6bbc22a2b57b97a758f4.zip
• implemented undeletion of default Bundles
• made usage of constants
Diffstat (limited to 'Source/SPAppController.m')
-rw-r--r--Source/SPAppController.m22
1 files changed, 15 insertions, 7 deletions
diff --git a/Source/SPAppController.m b/Source/SPAppController.m
index cbadfb85..268b7d14 100644
--- a/Source/SPAppController.m
+++ b/Source/SPAppController.m
@@ -1356,13 +1356,13 @@
NSArray *deletedDefaultBundles;
NSMutableArray *updatedDefaultBundles = [NSMutableArray array];
- if([[NSUserDefaults standardUserDefaults] objectForKey:@"deletedDefaultBundles"]) {
- deletedDefaultBundles = [[[NSUserDefaults standardUserDefaults] objectForKey:@"deletedDefaultBundles"] retain];
+ if([[NSUserDefaults standardUserDefaults] objectForKey:SPBundleDeletedDefaultBundlesKey]) {
+ deletedDefaultBundles = [[[NSUserDefaults standardUserDefaults] objectForKey:SPBundleDeletedDefaultBundlesKey] retain];
} else {
deletedDefaultBundles = [[NSArray array] retain];
}
- if([[NSUserDefaults standardUserDefaults] objectForKey:@"updatedDefaultBundles"]) {
- [updatedDefaultBundles setArray:[[NSUserDefaults standardUserDefaults] objectForKey:@"updatedDefaultBundles"]];
+ if([[NSUserDefaults standardUserDefaults] objectForKey:SPBundleUpdatedDefaultBundlesKey]) {
+ [updatedDefaultBundles setArray:[[NSUserDefaults standardUserDefaults] objectForKey:SPBundleUpdatedDefaultBundlesKey]];
}
NSMutableString *infoAboutUpdatedDefaultBundles = [NSMutableString string];
@@ -1406,8 +1406,16 @@
if(processDefaultBundles) {
// Skip deleted default Bundles
- if([deletedDefaultBundles containsObject:[cmdData objectForKey:SPBundleFileUUIDKey]])
- continue;
+ BOOL bundleWasDeleted = NO;
+ if([deletedDefaultBundles count]) {
+ for(NSArray* item in deletedDefaultBundles) {
+ if([[item objectAtIndex:0] isEqualToString:[cmdData objectForKey:SPBundleFileUUIDKey]]) {
+ bundleWasDeleted = YES;
+ break;
+ }
+ }
+ }
+ if(bundleWasDeleted) continue;
// If default Bundle is already install check for possible update,
// if so duplicate the modified one by appending (user) and updated it
@@ -1618,7 +1626,7 @@
[deletedDefaultBundles release];
// Synchronize updated Bundles
- [[NSUserDefaults standardUserDefaults] setObject:updatedDefaultBundles forKey:@"updatedDefaultBundles"];
+ [[NSUserDefaults standardUserDefaults] setObject:updatedDefaultBundles forKey:SPBundleUpdatedDefaultBundlesKey];
// Inform user about default Bundle updates which were modified by the user and re-run Reload Bundles
if([infoAboutUpdatedDefaultBundles length]) {