aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPConnectionController.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPConnectionController.m')
-rw-r--r--Source/SPConnectionController.m26
1 files changed, 15 insertions, 11 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m
index 937cb521..f5d02a61 100644
--- a/Source/SPConnectionController.m
+++ b/Source/SPConnectionController.m
@@ -1138,17 +1138,21 @@ static NSComparisonResult compareFavoritesUsingKey(id favorite1, id favorite2, v
*/
- (void)importExportFavoritesSheetDidEnd:(NSOpenPanel *)panel returnCode:(NSInteger)returnCode contextInfo:(NSString *)contextInfo
{
- if (contextInfo == SPExportFavorites) {
- SPFavoritesExporter *exporter = [[[SPFavoritesExporter alloc] init] autorelease];
-
- [exporter setDelegate:self];
-
- [exporter writeFavorites:[self selectedFavoriteNodes] toFile:[panel filename]];
- }
- else if (contextInfo == SPImportFavorites) {
- SPFavoritesImporter *importer = [[SPFavoritesImporter alloc] init];
-
- [importer setDelegate:self];
+ if (returnCode == NSOKButton) {
+ if (contextInfo == SPExportFavorites) {
+ SPFavoritesExporter *exporter = [[[SPFavoritesExporter alloc] init] autorelease];
+
+ [exporter setDelegate:self];
+
+ [exporter writeFavorites:[self selectedFavoriteNodes] toFile:[panel filename]];
+ }
+ else if (contextInfo == SPImportFavorites) {
+ SPFavoritesImporter *importer = [[SPFavoritesImporter alloc] init];
+
+ [importer setDelegate:self];
+
+ [importer importFavoritesFromFileAtPath:[panel filename]];
+ }
}
}