diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-06-06 23:34:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-06-07 19:23:40 +0300 |
commit | 36ba43d6ea38062b17f7e63ef659962bfc51c64d (patch) | |
tree | 190156cb88b13a38a6d13c69ee0742cc078065a1 /src/gui/windows/serverdialog.cpp | |
parent | f1518dd8476c968a43fa57cfb06198e290a4f77a (diff) | |
download | mv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz mv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2 mv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz mv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip |
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/gui/windows/serverdialog.cpp')
-rw-r--r-- | src/gui/windows/serverdialog.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp index a86fa0b1e..51f937666 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -199,7 +199,7 @@ void ServerDialog::postInit() ServerDialog::~ServerDialog() { - if (mDownload) + if (mDownload != nullptr) { mDownload->cancel(); delete2(mDownload) @@ -216,7 +216,7 @@ void ServerDialog::connectToSelectedServer() if (index < 0) return; - if (mDownload) + if (mDownload != nullptr) mDownload->cancel(); mQuitButton->setEnabled(false); @@ -244,7 +244,7 @@ void ServerDialog::connectToSelectedServer() settings.supportUrl = mServerInfo->supportUrl; settings.updateMirrors = mServerInfo->updateMirrors; - if (chatLogger) + if (chatLogger != nullptr) chatLogger->setServerName(mServerInfo->hostname); saveCustomServers(*mServerInfo); @@ -254,7 +254,7 @@ void ServerDialog::connectToSelectedServer() if (mServerInfo->hostname != LoginDialog::savedPasswordKey) { LoginDialog::savedPassword.clear(); - if (desktop) + if (desktop != nullptr) desktop->reloadWallpaper(); } } @@ -433,7 +433,7 @@ void ServerDialog::downloadServerList() if (listFile.empty()) listFile = "http://manaplus.org/serverlist.xml"; - if (mDownload) + if (mDownload != nullptr) { mDownload->cancel(); delete2(mDownload) @@ -485,7 +485,7 @@ void ServerDialog::loadServers(const bool addNew) SkipError_false); XmlNodeConstPtr rootNode = doc.rootNode(); - if (!rootNode || !xmlNameEqual(rootNode, "serverlist")) + if ((rootNode == nullptr) || !xmlNameEqual(rootNode, "serverlist")) { logger->log1("Error loading server list!"); return; @@ -663,7 +663,7 @@ void ServerDialog::loadCustomServers() server.hostname = config.getValue(hostKey, ""); server.type = ServerInfo::parseType(config.getValue(typeKey, "")); server.persistentIp = config.getValue( - persistentIpKey, 0) ? true : false; + persistentIpKey, 0) != 0 ? true : false; server.packetVersion = config.getValue(packetVersionKey, 0); const int defaultPort = defaultPortForServerType(server.type); @@ -747,13 +747,13 @@ int ServerDialog::downloadUpdate(void *ptr, size_t total, const size_t remaining) { - if (!ptr || status == DownloadStatus::Cancelled) + if ((ptr == nullptr) || status == DownloadStatus::Cancelled) return -1; ServerDialog *const sd = reinterpret_cast<ServerDialog*>(ptr); bool finished = false; - if (!sd->mDownload) + if (sd->mDownload == nullptr) return -1; if (status == DownloadStatus::Complete) @@ -769,7 +769,7 @@ int ServerDialog::downloadUpdate(void *ptr, else { float progress = static_cast<float>(remaining); - if (total) + if (total != 0u) progress /= static_cast<float>(total); if (progress != progress || progress < 0.0F) @@ -809,7 +809,7 @@ bool ServerDialog::needUpdateServers() const void ServerDialog::close() { - if (mDownload) + if (mDownload != nullptr) mDownload->cancel(); client->setState(State::FORCE_QUIT); Window::close(); |