diff options
author | stuconnolly <stuart02@gmail.com> | 2013-10-27 16:15:12 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2013-10-27 16:15:12 +0000 |
commit | 0c4901239d3c0e0235e746103879f6278b3bc64f (patch) | |
tree | 8a38d24c94d9f24f25044dbc2befcf1473e3f4b7 /Source/SPFavoritesController.m | |
parent | 9c240bfce5e73b3a28e58c0fa0aba76a6778e8c8 (diff) | |
download | sequelpro-0c4901239d3c0e0235e746103879f6278b3bc64f.tar.gz sequelpro-0c4901239d3c0e0235e746103879f6278b3bc64f.tar.bz2 sequelpro-0c4901239d3c0e0235e746103879f6278b3bc64f.zip |
Ensure the relations table view is refreshed after field changes result in a dropped relationship. Fixes issue #1591.
Diffstat (limited to 'Source/SPFavoritesController.m')
-rw-r--r-- | Source/SPFavoritesController.m | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/SPFavoritesController.m b/Source/SPFavoritesController.m index e883d876..9ecee454 100644 --- a/Source/SPFavoritesController.m +++ b/Source/SPFavoritesController.m @@ -380,15 +380,16 @@ static SPFavoritesController *sharedFavoritesController = nil; // to create the plist data. This is done before file changes as it can sometimes // be terminated during shutdown. NSDictionary *dictionary = [NSDictionary dictionaryWithObject:data forKey:SPFavoritesRootKey]; + NSData *plistData = [NSPropertyListSerialization dataFromPropertyList:dictionary format:NSPropertyListXMLFormat_v1_0 errorDescription:&errorString]; if (errorString) { NSLog(@"Error converting favorites data to plist format: %@", errorString); + [errorString release]; } - NSFileManager *fileManager = [NSFileManager defaultManager]; NSString *dataPath = [fileManager applicationSupportDirectoryForSubDirectory:SPDataSupportFolder error:&error]; @@ -430,13 +431,14 @@ static SPFavoritesController *sharedFavoritesController = nil; // Restore the original data file error = nil; + [fileManager moveItemAtPath:favoritesBackupFile toPath:favoritesFile error:&error]; + if (error) { NSLog(@"Could not restore backup; favorites.plist left renamed as %@ due to error (%@)", favoritesBackupFile, [error localizedDescription]); } } else { - // Remove the original backup [fileManager removeItemAtPath:favoritesBackupFile error:NULL]; } |