Rename is_valid to isValid

This commit is contained in:
Charlie Qiu
2016-06-09 05:44:18 +08:00
parent 2491224f7d
commit 33a093950e
4 changed files with 14 additions and 6 deletions

View File

@ -145,6 +145,14 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
}
@IBAction func selectPACMode(sender: NSMenuItem) {
}
@IBAction func selectGlobalMode(sender: NSMenuItem) {
}
@IBAction func editServerPreferences(sender: NSMenuItem) {
if preferencesWinCtrl != nil {
preferencesWinCtrl.close()
@ -212,7 +220,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
if mgr.activeProfileId == p.uuid {
item.state = 1
}
if !p.is_valid() {
if !p.isValid() {
item.enabled = false
}
item.action = #selector(AppDelegate.selectServer)

View File

@ -55,7 +55,7 @@ class PreferencesWindowController: NSWindowController
}
@IBAction func addProfile(sender: NSButton) {
if editingProfile != nil && !editingProfile.is_valid(){
if editingProfile != nil && !editingProfile.isValid(){
return
}
profilesTableView.beginUpdates()
@ -85,7 +85,7 @@ class PreferencesWindowController: NSWindowController
@IBAction func ok(sender: NSButton) {
if editingProfile != nil {
if !editingProfile.is_valid() {
if !editingProfile.isValid() {
// TODO Shake window?
return
}
@ -190,7 +190,7 @@ class PreferencesWindowController: NSWindowController
return true
}
if editingProfile != nil {
if !editingProfile.is_valid() {
if !editingProfile.isValid() {
return false
}
}

View File

@ -76,7 +76,7 @@ class ServerProfile: NSObject {
return conf
}
func is_valid() -> Bool {
func isValid() -> Bool {
func validateIpAddress(ipToValidate: String) -> Bool {
var sin = sockaddr_in()

View File

@ -36,7 +36,7 @@ class ServerProfileManager: NSObject {
let defaults = NSUserDefaults.standardUserDefaults()
var _profiles = [AnyObject]()
for profile in profiles {
if profile.is_valid() {
if profile.isValid() {
let _profile = profile.toDictionary()
_profiles.append(_profile)
}