Refactor ParseSSURL as ServerProfile initializer

This commit is contained in:
Rainux Luo
2017-01-09 21:49:09 +08:00
parent c50e18d832
commit dbc6ee92d5
6 changed files with 91 additions and 84 deletions

View File

@ -121,9 +121,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
var isChanged = false
for url in urls {
let profielDict = ParseSSURL(url)
if let profielDict = profielDict {
let profile = ServerProfile.fromDictionary(profielDict)
if let profile = ServerProfile(url: url) {
mgr.profiles.append(profile)
isChanged = true