From b256111a17ba9ea223b7d706eebf66605e46c701 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Tue, 21 Jun 2016 20:02:18 -0700 Subject: [PATCH] misc cleanup --- ZeroTier One/AppDelegate.swift | 8 +++++++- ZeroTier One/ServiceCom.swift | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ZeroTier One/AppDelegate.swift b/ZeroTier One/AppDelegate.swift index dc7a3b9ae..8e0cbf106 100644 --- a/ZeroTier One/AppDelegate.swift +++ b/ZeroTier One/AppDelegate.swift @@ -109,7 +109,13 @@ class AppDelegate: NSObject, NSApplicationDelegate { if networks.count > 0 { for net in networks { let id = String(net.nwid, radix: 16) - let networkName = "\(id) (\(net.name))" + var networkName = "" + if net.name.isEmpty { + networkName = "\(id)" + } + else { + networkName = "\(id) (\(net.name))" + } let item = NSMenuItem(title: networkName, action: #selector(AppDelegate.toggleNetwork(_:)), keyEquivalent: "") diff --git a/ZeroTier One/ServiceCom.swift b/ZeroTier One/ServiceCom.swift index 21d5529c6..23c194c27 100644 --- a/ZeroTier One/ServiceCom.swift +++ b/ZeroTier One/ServiceCom.swift @@ -133,10 +133,10 @@ class ServiceCom: NSObject { let status = httpResponse.statusCode if status == 200 { - print("join ok") + NSLog("join ok") } else { - print("join error: \(status)") + NSLog("join error: \(status)") } } @@ -158,10 +158,10 @@ class ServiceCom: NSObject { let status = httpResponse.statusCode if status == 200 { - print("leave ok") + NSLog("leave ok") } else { - print("leave error: \(status)") + NSLog("leave error: \(status)") } }