diff options
author | Bibiko <bibiko@eva.mpg.de> | 2011-01-03 12:49:49 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2011-01-03 12:49:49 +0000 |
commit | c668c662b616ec378f6ff8315055b46acbc923cc (patch) | |
tree | 8c0a7a860bd81e9ede9a66120965a9cb5b3409c9 /Source/SPAppController.m | |
parent | 8a2cdc1581e018984a7bd5c34d510c7c32eef3f1 (diff) | |
download | sequelpro-c668c662b616ec378f6ff8315055b46acbc923cc.tar.gz sequelpro-c668c662b616ec378f6ff8315055b46acbc923cc.tar.bz2 sequelpro-c668c662b616ec378f6ff8315055b46acbc923cc.zip |
• changed the way to check for available update of Default Bundles
- perform a check only if the revision number is greater as the last recorded one, in other words if an updated version of Sequel Pro was installed and runs for the very first time
Diffstat (limited to 'Source/SPAppController.m')
-rw-r--r-- | Source/SPAppController.m | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/Source/SPAppController.m b/Source/SPAppController.m index 25a181fa..ec853140 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -1353,19 +1353,17 @@ BOOL processDefaultBundles = NO; NSFileManager *fm = [NSFileManager defaultManager]; - + NSArray *deletedDefaultBundles; - NSMutableArray *updatedDefaultBundles = [NSMutableArray array]; + if([[NSUserDefaults standardUserDefaults] objectForKey:SPBundleDeletedDefaultBundlesKey]) { deletedDefaultBundles = [[[NSUserDefaults standardUserDefaults] objectForKey:SPBundleDeletedDefaultBundlesKey] retain]; } else { deletedDefaultBundles = [[NSArray array] retain]; } - if([[NSUserDefaults standardUserDefaults] objectForKey:SPBundleUpdatedDefaultBundlesKey]) { - [updatedDefaultBundles setArray:[[NSUserDefaults standardUserDefaults] objectForKey:SPBundleUpdatedDefaultBundlesKey]]; - } NSMutableString *infoAboutUpdatedDefaultBundles = [NSMutableString string]; + BOOL doBundleUpdate = ([[NSUserDefaults standardUserDefaults] objectForKey:@"doBundleUpdate"]) ? YES : NO; for(NSString* bundlePath in bundlePaths) { if([bundlePath length]) { @@ -1420,8 +1418,8 @@ // If default Bundle is already install check for possible update, // if so duplicate the modified one by appending (user) and updated it if([installedBundleUUIDs objectForKey:[cmdData objectForKey:SPBundleFileUUIDKey]]) { - if([updatedDefaultBundles containsObject:[cmdData objectForKey:SPBundleFileUUIDKey]]) { - + if(doBundleUpdate) { +NSLog(@"do update"); NSString *oldPath = [NSString stringWithFormat:@"%@/%@/%@", [bundlePaths objectAtIndex:0], bundle, SPBundleFileName]; NSError *readError = nil; NSString *convError = nil; @@ -1496,9 +1494,6 @@ } - // Remove item from update list which will be updated in the Prefs - [updatedDefaultBundles removeObject:[cmdData objectForKey:SPBundleFileUUIDKey]]; - } if (cmdData) [cmdData release]; @@ -1624,9 +1619,10 @@ } [deletedDefaultBundles release]; - - // Synchronize updated Bundles - [[NSUserDefaults standardUserDefaults] setObject:updatedDefaultBundles forKey:SPBundleUpdatedDefaultBundlesKey]; + if(doBundleUpdate) { + [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"doBundleUpdate"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + } // Inform user about default Bundle updates which were modified by the user and re-run Reload Bundles if([infoAboutUpdatedDefaultBundles length]) { |