From e944c819d97bbb516f287dc2890639f98db29c1e Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 19 Jan 2019 21:32:35 -0800 Subject: [PATCH] Add prefix for NvLogLevel enum values --- app/backend/computermanager.cpp | 6 +++--- app/backend/nvhttp.cpp | 12 ++++++------ app/backend/nvhttp.h | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/backend/computermanager.cpp b/app/backend/computermanager.cpp index 1106d8e4..abbbbb3c 100644 --- a/app/backend/computermanager.cpp +++ b/app/backend/computermanager.cpp @@ -31,7 +31,7 @@ private: QString serverInfo; try { - serverInfo = http.getServerInfo(NvHTTP::NvLogLevel::NONE); + serverInfo = http.getServerInfo(NvHTTP::NvLogLevel::NVLL_NONE); } catch (...) { return false; } @@ -511,12 +511,12 @@ private: // around this issue, we will issue the request again after a few seconds if // we see a ServiceUnavailableError error. try { - serverInfo = http.getServerInfo(NvHTTP::NvLogLevel::VERBOSE); + serverInfo = http.getServerInfo(NvHTTP::NVLL_VERBOSE); } catch (const QtNetworkReplyException& e) { if (e.getError() == QNetworkReply::ServiceUnavailableError) { qWarning() << "Retrying request in 5 seconds after ServiceUnavailableError"; QThread::sleep(5); - serverInfo = http.getServerInfo(NvHTTP::NvLogLevel::VERBOSE); + serverInfo = http.getServerInfo(NvHTTP::NVLL_VERBOSE); qInfo() << "Retry successful"; } else { diff --git a/app/backend/nvhttp.cpp b/app/backend/nvhttp.cpp index d1d3acba..6a7078eb 100644 --- a/app/backend/nvhttp.cpp +++ b/app/backend/nvhttp.cpp @@ -223,7 +223,7 @@ NvHTTP::quitApp() // Newer GFE versions will just return success even if quitting fails // if we're not the original requestor. - if (getCurrentGame(getServerInfo(NvHTTP::ERROR)) != 0) { + if (getCurrentGame(getServerInfo(NvHTTP::NVLL_ERROR)) != 0) { // Generate a synthetic GfeResponseException letting the caller know // that they can't kill someone else's stream. throw GfeHttpResponseException(599, ""); @@ -264,7 +264,7 @@ NvHTTP::getAppList() "applist", nullptr, REQUEST_TIMEOUT_MS, - NvLogLevel::ERROR); + NvLogLevel::NVLL_ERROR); verifyResponseStatus(appxml); QXmlStreamReader xmlReader(appxml); @@ -332,7 +332,7 @@ NvHTTP::getBoxArt(int appId) "appid="+QString::number(appId)+ "&AssetType=2&AssetIdx=0", REQUEST_TIMEOUT_MS, - NvLogLevel::VERBOSE); + NvLogLevel::NVLL_VERBOSE); QImage image = QImageReader(reply).read(); delete reply; @@ -440,7 +440,7 @@ NvHTTP::openConnection(QUrl baseUrl, if (timeoutMs) { QTimer::singleShot(timeoutMs, &loop, SLOT(quit())); } - if (logLevel >= NvLogLevel::VERBOSE) { + if (logLevel >= NvLogLevel::NVLL_VERBOSE) { qInfo() << "Executing request:" << url.toString(); } loop.exec(QEventLoop::ExcludeUserInputEvents); @@ -448,7 +448,7 @@ NvHTTP::openConnection(QUrl baseUrl, // Abort the request if it timed out if (!reply->isFinished()) { - if (logLevel >= NvLogLevel::ERROR) { + if (logLevel >= NvLogLevel::NVLL_ERROR) { qWarning() << "Aborting timed out request for" << url.toString(); } reply->abort(); @@ -461,7 +461,7 @@ NvHTTP::openConnection(QUrl baseUrl, // Handle error if (reply->error() != QNetworkReply::NoError) { - if (logLevel >= NvLogLevel::ERROR) { + if (logLevel >= NvLogLevel::NVLL_ERROR) { qWarning() << command << " request failed with error " << reply->error(); } diff --git a/app/backend/nvhttp.h b/app/backend/nvhttp.h index 3586400f..1bbf86dc 100644 --- a/app/backend/nvhttp.h +++ b/app/backend/nvhttp.h @@ -117,9 +117,9 @@ class NvHTTP { public: enum NvLogLevel { - NONE, - ERROR, - VERBOSE + NVLL_NONE, + NVLL_ERROR, + NVLL_VERBOSE }; explicit NvHTTP(QString address, QSslCertificate serverCert); @@ -150,7 +150,7 @@ public: QString command, QString arguments, int timeoutMs, - NvLogLevel logLevel = NvLogLevel::VERBOSE); + NvLogLevel logLevel = NvLogLevel::NVLL_VERBOSE); void setServerCert(QSslCertificate serverCert);