diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-10-07 03:26:20 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-10-07 03:26:20 -0400 |
| commit | f10e91528b96a2588a321ef33fa65c527b816ccf (patch) | |
| tree | 2b3c730c448562138841ef4e617375dab79752f0 | |
| parent | 96c319325626959b437e1fb72bb0a97c176785a7 (diff) | |
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
| -rw-r--r-- | src/apiuseraccount.cpp | 2 | ||||
| -rw-r--r-- | src/apiuseraccount.h | 6 | ||||
| -rw-r--r-- | src/nxmaccessmanager.cpp | 6 |
3 files changed, 9 insertions, 5 deletions
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<NXMAccessManager*>(this)->startProgress(); } - return (m_validationState == Valid); + return false; } void NXMAccessManager::refuseValidation() |
