Remove redundant QString construction

This commit is contained in:
Cameron Gutman
2026-05-23 19:28:28 -05:00
parent 63c48be6d4
commit d9eca42311
2 changed files with 11 additions and 11 deletions
+10 -10
View File
@@ -266,17 +266,17 @@ NvHTTP::getDisplayModeList(QString serverInfo)
while (!xmlReader.atEnd()) { while (!xmlReader.atEnd()) {
while (xmlReader.readNextStartElement()) { while (xmlReader.readNextStartElement()) {
auto name = xmlReader.name(); auto name = xmlReader.name();
if (name == QString("DisplayMode")) { if (name == "DisplayMode") {
modes.append(NvDisplayMode()); modes.append(NvDisplayMode());
} }
else if (!modes.isEmpty()) { else if (!modes.isEmpty()) {
if (name == QString("Width")) { if (name == "Width") {
modes.last().width = xmlReader.readElementText().toInt(); modes.last().width = xmlReader.readElementText().toInt();
} }
else if (name == QString("Height")) { else if (name == "Height") {
modes.last().height = xmlReader.readElementText().toInt(); modes.last().height = xmlReader.readElementText().toInt();
} }
else if (name == QString("RefreshRate")) { else if (name == "RefreshRate") {
modes.last().refreshRate = xmlReader.readElementText().toInt(); modes.last().refreshRate = xmlReader.readElementText().toInt();
} }
} }
@@ -301,7 +301,7 @@ NvHTTP::getAppList()
while (!xmlReader.atEnd()) { while (!xmlReader.atEnd()) {
while (xmlReader.readNextStartElement()) { while (xmlReader.readNextStartElement()) {
auto name = xmlReader.name(); auto name = xmlReader.name();
if (name == QString("App")) { if (name == "App") {
// We must have a valid app before advancing to the next one // We must have a valid app before advancing to the next one
if (!apps.isEmpty() && !apps.last().isInitialized()) { if (!apps.isEmpty() && !apps.last().isInitialized()) {
qWarning() << "Invalid applist XML"; qWarning() << "Invalid applist XML";
@@ -310,16 +310,16 @@ NvHTTP::getAppList()
apps.append(NvApp()); apps.append(NvApp());
} }
else if (!apps.isEmpty()) { else if (!apps.isEmpty()) {
if (name == QString("AppTitle")) { if (name == "AppTitle") {
apps.last().name = xmlReader.readElementText(); apps.last().name = xmlReader.readElementText();
} }
else if (name == QString("ID")) { else if (name == "ID") {
apps.last().id = xmlReader.readElementText().toInt(); apps.last().id = xmlReader.readElementText().toInt();
} }
else if (name == QString("IsHdrSupported")) { else if (name == "IsHdrSupported") {
apps.last().hdrSupported = xmlReader.readElementText() == "1"; apps.last().hdrSupported = xmlReader.readElementText() == "1";
} }
else if (name == QString("IsAppCollectorGame")) { else if (name == "IsAppCollectorGame") {
apps.last().isAppCollectorGame = xmlReader.readElementText() == "1"; apps.last().isAppCollectorGame = xmlReader.readElementText() == "1";
} }
} }
@@ -336,7 +336,7 @@ NvHTTP::verifyResponseStatus(QString xml)
while (xmlReader.readNextStartElement()) while (xmlReader.readNextStartElement())
{ {
if (xmlReader.name() == QString("root")) if (xmlReader.name() == "root")
{ {
// Status code can be 0xFFFFFFFF in some rare cases on GFE 3.20.3, and // Status code can be 0xFFFFFFFF in some rare cases on GFE 3.20.3, and
// QString::toInt() will fail in that case, so use QString::toUInt() // QString::toInt() will fail in that case, so use QString::toUInt()
+1 -1
View File
@@ -195,7 +195,7 @@ GlobalCommandLineParser::ParseResult GlobalCommandLineParser::parse(const QStrin
} }
} }
parser.showError(QString("Invalid action")); parser.showError("Invalid action");
} }
} }