aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPFavoritesImporter.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2013-03-11 00:11:18 +0000
committerrowanbeentje <rowan@beent.je>2013-03-11 00:11:18 +0000
commitcd3325991d97ca1e3104b919f21c499f00d4720a (patch)
tree11554d9e04be8a5715ed754e935695054e3bda5f /Source/SPFavoritesImporter.m
parent44d72e95870de18e00e270f496971e4c968c3834 (diff)
downloadsequelpro-cd3325991d97ca1e3104b919f21c499f00d4720a.tar.gz
sequelpro-cd3325991d97ca1e3104b919f21c499f00d4720a.tar.bz2
sequelpro-cd3325991d97ca1e3104b919f21c499f00d4720a.zip
- Allow Favorites import to read favorites from an old preferences .plist file, further addressing Issue #1588
Diffstat (limited to 'Source/SPFavoritesImporter.m')
-rw-r--r--Source/SPFavoritesImporter.m12
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/SPFavoritesImporter.m b/Source/SPFavoritesImporter.m
index bb027104..b8888537 100644
--- a/Source/SPFavoritesImporter.m
+++ b/Source/SPFavoritesImporter.m
@@ -33,6 +33,8 @@
#import "SPFavoritesImporter.h"
#import "SPThreadAdditions.h"
+static NSString *SPOldPreferenceFileFavoritesKey = @"favorites";
+
@interface SPFavoritesImporter ()
- (void)_importFavoritesInBackground;
@@ -81,8 +83,14 @@
[self _informDelegateOfImportDataAvailable:favorites];
}
else {
- [self _informDelegateOfErrorCode:NSFileReadUnknownError
- description:NSLocalizedString(@"Error reading import file.", @"error reading import file")];
+
+ // Check to see whether we're importing favorites from an old preferences file
+ if ([importData valueForKey:SPOldPreferenceFileFavoritesKey]) {
+ [self _informDelegateOfImportDataAvailable:[importData valueForKey:SPOldPreferenceFileFavoritesKey]];
+ } else {
+ [self _informDelegateOfErrorCode:NSFileReadUnknownError
+ description:NSLocalizedString(@"Error reading import file.", @"error reading import file")];
+ }
}
}
else {