From eed9fca10c411b2eda8e30bc6094ca07e67e39bf Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 14 Sep 2018 18:36:15 -0700 Subject: [PATCH] Mass conversion of isNull() -> isEmpty() --- app/backend/computermanager.cpp | 10 +++++----- app/backend/identitymanager.cpp | 4 ++-- app/backend/nvhttp.h | 2 +- app/gui/computermodel.cpp | 2 +- app/streaming/session.cpp | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/backend/computermanager.cpp b/app/backend/computermanager.cpp index 1717ab9a..0f56df17 100644 --- a/app/backend/computermanager.cpp +++ b/app/backend/computermanager.cpp @@ -93,7 +93,7 @@ void NvComputer::sortAppList() NvComputer::NvComputer(QString address, QString serverInfo) { this->name = NvHTTP::getXmlString(serverInfo, "hostname"); - if (this->name.isNull()) { + if (this->name.isEmpty()) { this->name = "UNKNOWN"; } @@ -107,7 +107,7 @@ NvComputer::NvComputer(QString address, QString serverInfo) } QString codecSupport = NvHTTP::getXmlString(serverInfo, "ServerCodecModeSupport"); - if (!codecSupport.isNull()) { + if (!codecSupport.isEmpty()) { this->serverCodecModeSupport = codecSupport.toInt(); } else { @@ -115,7 +115,7 @@ NvComputer::NvComputer(QString address, QString serverInfo) } QString maxLumaPixelsHEVC = NvHTTP::getXmlString(serverInfo, "MaxLumaPixelsHEVC"); - if (!maxLumaPixelsHEVC.isNull()) { + if (!maxLumaPixelsHEVC.isEmpty()) { this->maxLumaPixelsHEVC = maxLumaPixelsHEVC.toInt(); } else { @@ -149,7 +149,7 @@ bool NvComputer::wake() return true; } - if (macAddress.isNull()) { + if (macAddress.isEmpty()) { qWarning() << name << "has no MAC address stored"; return false; } @@ -217,7 +217,7 @@ QVector NvComputer::uniqueAddresses() // Prune duplicates (always giving precedence to the first) for (int i = 0; i < uniqueAddressList.count(); i++) { - if (uniqueAddressList[i].isEmpty() || uniqueAddressList[i].isNull()) { + if (uniqueAddressList[i].isEmpty()) { uniqueAddressList.remove(i); i--; continue; diff --git a/app/backend/identitymanager.cpp b/app/backend/identitymanager.cpp index 391dc814..1146ab14 100644 --- a/app/backend/identitymanager.cpp +++ b/app/backend/identitymanager.cpp @@ -185,12 +185,12 @@ IdentityManager::getSslConfig() QString IdentityManager::getUniqueId() { - if (m_CachedUniqueId.isNull()) { + if (m_CachedUniqueId.isEmpty()) { QSettings settings; // Load the unique ID from settings m_CachedUniqueId = settings.value(SER_UNIQUEID).toString(); - if (!m_CachedUniqueId.isEmpty() && !m_CachedUniqueId.isNull()) { + if (!m_CachedUniqueId.isEmpty()) { qInfo() << "Loaded unique ID from settings:" << m_CachedUniqueId; } else { diff --git a/app/backend/nvhttp.h b/app/backend/nvhttp.h index 60f703e6..bc033a9e 100644 --- a/app/backend/nvhttp.h +++ b/app/backend/nvhttp.h @@ -17,7 +17,7 @@ public: bool isInitialized() { - return id != 0 && !name.isNull(); + return id != 0 && !name.isEmpty(); } int id; diff --git a/app/gui/computermodel.cpp b/app/gui/computermodel.cpp index 5a3f87a5..461928db 100644 --- a/app/gui/computermodel.cpp +++ b/app/gui/computermodel.cpp @@ -153,7 +153,7 @@ void ComputerModel::pairComputer(int computerIndex, QString pin) void ComputerModel::handlePairingCompleted(NvComputer*, QString error) { - emit pairingCompleted(error.isNull() ? QVariant() : error); + emit pairingCompleted(error.isEmpty() ? QVariant() : error); } void ComputerModel::handleComputerStateChanged(NvComputer* computer) diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index f461b1a1..c9eccfcd 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -495,7 +495,7 @@ bool Session::validateLaunch() if (m_StreamConfig.width >= 3840) { // Only allow 4K on GFE 3.x+ - if (m_Computer->gfeVersion.isNull() || m_Computer->gfeVersion.startsWith("2.")) { + if (m_Computer->gfeVersion.isEmpty() || m_Computer->gfeVersion.startsWith("2.")) { emitLaunchWarning("GeForce Experience 3.0 or higher is required for 4K streaming."); m_StreamConfig.width = 1920; @@ -787,10 +787,10 @@ void Session::exec(int displayOriginX, int displayOriginY) // Older GFE versions didn't have this field QByteArray siGfeVersion; - if (!m_Computer->gfeVersion.isNull()) { + if (!m_Computer->gfeVersion.isEmpty()) { siGfeVersion = m_Computer->gfeVersion.toLatin1(); } - if (!siGfeVersion.isNull()) { + if (!siGfeVersion.isEmpty()) { hostInfo.serverInfoGfeVersion = siGfeVersion.data(); }