From cd3325991d97ca1e3104b919f21c499f00d4720a Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Mon, 11 Mar 2013 00:11:18 +0000 Subject: - Allow Favorites import to read favorites from an old preferences .plist file, further addressing Issue #1588 --- Source/SPFavoritesImporter.m | 12 ++++++++++-- 1 file 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 { -- cgit v1.2.3