From f10e91528b96a2588a321ef33fa65c527b816ccf Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Mon, 7 Oct 2019 03:26:20 -0400 Subject: remaining requests can be 0 if not logged in, would show incorrect throttling message validation dialog could pop even if logged in typos in comments --- src/apiuseraccount.cpp | 2 +- src/apiuseraccount.h | 6 +++--- src/nxmaccessmanager.cpp | 6 +++++- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/apiuseraccount.cpp b/src/apiuseraccount.cpp index 35a868d5..976dd488 100644 --- a/src/apiuseraccount.cpp +++ b/src/apiuseraccount.cpp @@ -96,5 +96,5 @@ bool APIUserAccount::shouldThrottle() const bool APIUserAccount::exhausted() const { - return (remainingRequests() <= 0); + return isValid() && (remainingRequests() <= 0); } diff --git a/src/apiuseraccount.h b/src/apiuseraccount.h index ea4e8685..ac8931cf 100644 --- a/src/apiuseraccount.h +++ b/src/apiuseraccount.h @@ -51,12 +51,12 @@ struct APIStats /** -* represents a user account on the mod provier website +* represents a user account on the mod provider website */ class APIUserAccount { public: - // when the number of remanining requests is under this number, further + // when the number of remaining requests is under this number, further // requests will be throttled by avoiding non-critical ones static const int ThrottleThreshold = 200; @@ -110,7 +110,7 @@ public: APIUserAccount& name(const QString& name); /** - * sets the acount type + * sets the account type */ APIUserAccount& type(APIUserAccountTypes type); diff --git a/src/nxmaccessmanager.cpp b/src/nxmaccessmanager.cpp index 5d8b8b9e..e5f1fffe 100644 --- a/src/nxmaccessmanager.cpp +++ b/src/nxmaccessmanager.cpp @@ -886,11 +886,15 @@ void NXMAccessManager::onValidatorAttemptFinished(const ValidationAttempt& a) bool NXMAccessManager::validated() const { + if (m_validationState == Valid) { + return true; + } + if (m_validator.isActive()) { const_cast(this)->startProgress(); } - return (m_validationState == Valid); + return false; } void NXMAccessManager::refuseValidation() -- cgit v1.3.1