X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/65391c8ffcb388cd31f610776654f50aed97cbee..64ea838d8f4d1853b7d850db93ee565e901d099a:/src/unix/net.cpp?ds=sidebyside diff --git a/src/unix/net.cpp b/src/unix/net.cpp index ab4936b946..268eb46b06 100644 --- a/src/unix/net.cpp +++ b/src/unix/net.cpp @@ -1,5 +1,5 @@ // -*- c++ -*- /////////////////////////////////////////////////////////////// -// Name: unix/net.cpp +// Name: src/unix/net.cpp // Purpose: Network related wxWindows classes and functions // Author: Karsten Ballüder // Modified by: @@ -236,8 +236,7 @@ wxDialUpManagerImpl::EnableAutoCheckOnlineStatus(size_t nSeconds) bool rc = m_timer->Start(nSeconds*1000); if(! rc) { - delete m_timer; - m_timer = NULL; + wxDELETE(m_timer); } return rc; } @@ -247,8 +246,7 @@ wxDialUpManagerImpl::DisableAutoCheckOnlineStatus() { wxASSERT(m_timer != NULL); m_timer->Stop(); - delete m_timer; - m_timer = NULL; + wxDELETE(m_timer); } @@ -257,15 +255,15 @@ wxDialUpManagerImpl::SetWellKnownHost(const wxString& hostname, int portno) { /// does hostname contain a port number? wxString port = hostname.After(':'); - if(port.Length()) + if(port.empty()) { - m_BeaconHost = hostname.Before(':'); - m_BeaconPort = atoi(port); + m_BeaconHost = hostname; + m_BeaconPort = portno; } else { - m_BeaconHost = hostname; - m_BeaconPort = portno; + m_BeaconHost = hostname.Before(':'); + m_BeaconPort = atoi(port); } } @@ -321,7 +319,7 @@ wxDialUpManagerImpl::CheckStatusInternal(void) // Let's try the ifconfig method first, should be fastest: if(m_CanUseIfconfig != 0) // unknown or yes { - wxASSERT(m_IfconfigPath.length()); + wxASSERT( !m_IfconfigPath.empty() ); wxString tmpfile = wxFileName::CreateTempFileName("_wxdialuptest"); wxString cmd = "/bin/sh -c \'";