aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPFavoritesImporter.m
diff options
context:
space:
mode:
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 8c2809e8..e948dabe 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 {