Do not use !str for checking wxString emptiness

While wxString::operator!() is a documented alternative to .empty() since
25 years, using it in just a handful of places in the codebase is not
consistent.

!str is arguably not very readable either, because std::string does not
have such an operator, and neither does e.g. Qt's QString. People would
generally except ! in the context of any kind of strings to check for null
pointer (char*), or an optional with a missing value (std::optional).
This commit is contained in:
Lauri Nurmi
2024-09-12 10:05:33 +03:00
parent 44068b5550
commit fe18212385
26 changed files with 45 additions and 45 deletions
+1 -1
View File
@@ -774,7 +774,7 @@ wxDialUpManagerImpl::NetConnection wxDialUpManagerImpl::CheckPing()
else if (wxFileExists( wxT("/usr/sbin/ping") ))
m_PingPath = wxT("/usr/sbin/ping");
#endif
if (!m_PingPath)
if (m_PingPath.empty())
{
m_CanUsePing = 0;
}