aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPPreferencesUpgrade.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPPreferencesUpgrade.m')
-rw-r--r--Source/SPPreferencesUpgrade.m23
1 files changed, 10 insertions, 13 deletions
diff --git a/Source/SPPreferencesUpgrade.m b/Source/SPPreferencesUpgrade.m
index 11cd146c..9cd0d471 100644
--- a/Source/SPPreferencesUpgrade.m
+++ b/Source/SPPreferencesUpgrade.m
@@ -414,29 +414,26 @@ void SPMigrateConnectionFavoritesData(void)
NSDictionary *newFavorites = @{SPFavoritesRootKey : [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Favorites", @"favorites label"), SPFavoritesGroupNameKey, favorites, SPFavoriteChildrenKey, nil]};
error = nil;
- NSString *errorString = nil;
- NSData *plistData = [NSPropertyListSerialization dataFromPropertyList:newFavorites
+ NSData *plistData = [NSPropertyListSerialization dataWithPropertyList:newFavorites
format:NSPropertyListXMLFormat_v1_0
- errorDescription:&errorString];
- if (plistData) {
+ options:0
+ error:&error];
+
+ if (error) {
+ NSLog(@"Error converting migrating favorites data to plist format: %@", error);
+ }
+ else if (plistData) {
[plistData writeToFile:favoritesFile options:NSAtomicWrite error:&error];
if (error) {
- NSLog(@"Error migrating favorites data: %@", [error localizedDescription]);
+ NSLog(@"Error migrating favorites data: %@", error);
}
else {
[prefs removeObjectForKey:SPOldFavoritesKey];
}
}
- else if (errorString) {
- NSLog(@"Error converting migrating favorites data to plist format: %@", errorString);
-
- [favorites release];
- [errorString release];
- return;
- }
-
+
[favorites release];
}