Add prefix for NvLogLevel enum values

This commit is contained in:
Cameron Gutman 2019-01-19 21:32:35 -08:00
parent 75f631599c
commit e944c819d9
3 changed files with 13 additions and 13 deletions

View File

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

View File

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

View File

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