From 2bb5579e5720f1e335386f97165cf90ccc6face4 Mon Sep 17 00:00:00 2001 From: qinyuhang Date: Sun, 28 Aug 2016 11:31:54 +0800 Subject: [PATCH] open Finder after export configs --- ShadowsocksX-NG/BunchImportUtils.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ShadowsocksX-NG/BunchImportUtils.swift b/ShadowsocksX-NG/BunchImportUtils.swift index b410b51..d7ee534 100644 --- a/ShadowsocksX-NG/BunchImportUtils.swift +++ b/ShadowsocksX-NG/BunchImportUtils.swift @@ -99,12 +99,12 @@ func exportConfigFile() { let readStringData = readString.dataUsingEncoding(NSUTF8StringEncoding) let jsonArr1 = try! NSJSONSerialization.JSONObjectWithData(readStringData!, options: NSJSONReadingOptions.MutableContainers) as! NSDictionary - var configsArray:NSMutableArray = [] + let configsArray:NSMutableArray = [] //not using var? for profile in profileMgr.profiles{ - var configProfile:NSMutableDictionary = [:] + let configProfile:NSMutableDictionary = [:] //not using var? //standard ss profile - configProfile.setValue(1, forKey: "enable") + configProfile.setValue(true, forKey: "enable") configProfile.setValue(profile.serverHost, forKey: "server") configProfile.setValue(NSNumber(unsignedShort:profile.serverPort), forKey: "server_port")//not work configProfile.setValue(profile.password, forKey: "password") @@ -136,6 +136,7 @@ func exportConfigFile() { if (result == NSFileHandlingPanelOKButton && (savePanel.URL) != nil) { //write jsonArr1 back to file try! jsonString.writeToFile((savePanel.URL?.path)!, atomically: true, encoding: NSUTF8StringEncoding) + NSWorkspace.sharedWorkspace().selectFile((savePanel.URL?.path)!, inFileViewerRootedAtPath: (savePanel.directoryURL?.path)!) } } }