From fafa9367dad30cc79c28fd6ce4305b1271ab119f Mon Sep 17 00:00:00 2001 From: Qiu Yuzhou Date: Thu, 30 Nov 2017 19:00:34 +0800 Subject: [PATCH] Simplify registering default of ProxyExceptions. --- ShadowsocksX-NG/AppDelegate.swift | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/ShadowsocksX-NG/AppDelegate.swift b/ShadowsocksX-NG/AppDelegate.swift index a545ec7..f4c023e 100755 --- a/ShadowsocksX-NG/AppDelegate.swift +++ b/ShadowsocksX-NG/AppDelegate.swift @@ -102,16 +102,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele "Kcptun.LocalHost": "127.0.0.1", "Kcptun.LocalPort": NSNumber(value: 8388), "Kcptun.Conn": NSNumber(value: 1), + "ProxyExceptions": "127.0.0.1, localhost, 192.168.0.0/16, 10.0.0.0/8", ]) - - // To keep the default exception values backward compatible, we set it - // to the previously hardcoded value if the key doesn't exist. - // Registering defaults won't work because the empty state is a valid - // value, and Cocoa Bindings won't distinguish between empty and string - // values. - if defaults.string(forKey: "ProxyExceptions") == nil { - defaults.set("127.0.0.1, localhost, 192.168.0.0/16, 10.0.0.0/8", forKey: "ProxyExceptions") - } statusItem = NSStatusBar.system.statusItem(withLength: AppDelegate.StatusItemIconWidth) let image : NSImage = NSImage(named: NSImage.Name(rawValue: "menu_icon"))!