Mass conversion of isNull() -> isEmpty()

This commit is contained in:
Cameron Gutman 2018-09-14 18:36:15 -07:00
parent 25d97e187a
commit eed9fca10c
5 changed files with 12 additions and 12 deletions

View file

@ -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<QString> 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;

View file

@ -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 {

View file

@ -17,7 +17,7 @@ public:
bool isInitialized()
{
return id != 0 && !name.isNull();
return id != 0 && !name.isEmpty();
}
int id;

View file

@ -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)

View file

@ -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();
}