mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2025-01-07 08:48:45 +00:00
Mass conversion of isNull() -> isEmpty()
This commit is contained in:
parent
25d97e187a
commit
eed9fca10c
5 changed files with 12 additions and 12 deletions
|
@ -93,7 +93,7 @@ void NvComputer::sortAppList()
|
||||||
NvComputer::NvComputer(QString address, QString serverInfo)
|
NvComputer::NvComputer(QString address, QString serverInfo)
|
||||||
{
|
{
|
||||||
this->name = NvHTTP::getXmlString(serverInfo, "hostname");
|
this->name = NvHTTP::getXmlString(serverInfo, "hostname");
|
||||||
if (this->name.isNull()) {
|
if (this->name.isEmpty()) {
|
||||||
this->name = "UNKNOWN";
|
this->name = "UNKNOWN";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ NvComputer::NvComputer(QString address, QString serverInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
QString codecSupport = NvHTTP::getXmlString(serverInfo, "ServerCodecModeSupport");
|
QString codecSupport = NvHTTP::getXmlString(serverInfo, "ServerCodecModeSupport");
|
||||||
if (!codecSupport.isNull()) {
|
if (!codecSupport.isEmpty()) {
|
||||||
this->serverCodecModeSupport = codecSupport.toInt();
|
this->serverCodecModeSupport = codecSupport.toInt();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -115,7 +115,7 @@ NvComputer::NvComputer(QString address, QString serverInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
QString maxLumaPixelsHEVC = NvHTTP::getXmlString(serverInfo, "MaxLumaPixelsHEVC");
|
QString maxLumaPixelsHEVC = NvHTTP::getXmlString(serverInfo, "MaxLumaPixelsHEVC");
|
||||||
if (!maxLumaPixelsHEVC.isNull()) {
|
if (!maxLumaPixelsHEVC.isEmpty()) {
|
||||||
this->maxLumaPixelsHEVC = maxLumaPixelsHEVC.toInt();
|
this->maxLumaPixelsHEVC = maxLumaPixelsHEVC.toInt();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -149,7 +149,7 @@ bool NvComputer::wake()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (macAddress.isNull()) {
|
if (macAddress.isEmpty()) {
|
||||||
qWarning() << name << "has no MAC address stored";
|
qWarning() << name << "has no MAC address stored";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -217,7 +217,7 @@ QVector<QString> NvComputer::uniqueAddresses()
|
||||||
|
|
||||||
// Prune duplicates (always giving precedence to the first)
|
// Prune duplicates (always giving precedence to the first)
|
||||||
for (int i = 0; i < uniqueAddressList.count(); i++) {
|
for (int i = 0; i < uniqueAddressList.count(); i++) {
|
||||||
if (uniqueAddressList[i].isEmpty() || uniqueAddressList[i].isNull()) {
|
if (uniqueAddressList[i].isEmpty()) {
|
||||||
uniqueAddressList.remove(i);
|
uniqueAddressList.remove(i);
|
||||||
i--;
|
i--;
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -185,12 +185,12 @@ IdentityManager::getSslConfig()
|
||||||
QString
|
QString
|
||||||
IdentityManager::getUniqueId()
|
IdentityManager::getUniqueId()
|
||||||
{
|
{
|
||||||
if (m_CachedUniqueId.isNull()) {
|
if (m_CachedUniqueId.isEmpty()) {
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|
||||||
// Load the unique ID from settings
|
// Load the unique ID from settings
|
||||||
m_CachedUniqueId = settings.value(SER_UNIQUEID).toString();
|
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;
|
qInfo() << "Loaded unique ID from settings:" << m_CachedUniqueId;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -17,7 +17,7 @@ public:
|
||||||
|
|
||||||
bool isInitialized()
|
bool isInitialized()
|
||||||
{
|
{
|
||||||
return id != 0 && !name.isNull();
|
return id != 0 && !name.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
int id;
|
int id;
|
||||||
|
|
|
@ -153,7 +153,7 @@ void ComputerModel::pairComputer(int computerIndex, QString pin)
|
||||||
|
|
||||||
void ComputerModel::handlePairingCompleted(NvComputer*, QString error)
|
void ComputerModel::handlePairingCompleted(NvComputer*, QString error)
|
||||||
{
|
{
|
||||||
emit pairingCompleted(error.isNull() ? QVariant() : error);
|
emit pairingCompleted(error.isEmpty() ? QVariant() : error);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComputerModel::handleComputerStateChanged(NvComputer* computer)
|
void ComputerModel::handleComputerStateChanged(NvComputer* computer)
|
||||||
|
|
|
@ -495,7 +495,7 @@ bool Session::validateLaunch()
|
||||||
|
|
||||||
if (m_StreamConfig.width >= 3840) {
|
if (m_StreamConfig.width >= 3840) {
|
||||||
// Only allow 4K on GFE 3.x+
|
// 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.");
|
emitLaunchWarning("GeForce Experience 3.0 or higher is required for 4K streaming.");
|
||||||
|
|
||||||
m_StreamConfig.width = 1920;
|
m_StreamConfig.width = 1920;
|
||||||
|
@ -787,10 +787,10 @@ void Session::exec(int displayOriginX, int displayOriginY)
|
||||||
|
|
||||||
// Older GFE versions didn't have this field
|
// Older GFE versions didn't have this field
|
||||||
QByteArray siGfeVersion;
|
QByteArray siGfeVersion;
|
||||||
if (!m_Computer->gfeVersion.isNull()) {
|
if (!m_Computer->gfeVersion.isEmpty()) {
|
||||||
siGfeVersion = m_Computer->gfeVersion.toLatin1();
|
siGfeVersion = m_Computer->gfeVersion.toLatin1();
|
||||||
}
|
}
|
||||||
if (!siGfeVersion.isNull()) {
|
if (!siGfeVersion.isEmpty()) {
|
||||||
hostInfo.serverInfoGfeVersion = siGfeVersion.data();
|
hostInfo.serverInfoGfeVersion = siGfeVersion.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue