diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-06-12 15:10:41 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-06-12 15:47:36 -0400 |
| commit | ebbc900755b09862be95d29d2a02b8abd1792a3a (patch) | |
| tree | 0b49cd9669e62cf04c6489d341a53eb0679d120d /src/nxmaccessmanager.cpp | |
| parent | 853c95b921f4fc3beb8daf71d79b44aa1ab06c92 (diff) | |
added a few helper classes for user accounts and stats
moved the api label to the status bar
refactored a bunch of copy/pasted code in NexusInterface to use shouldThrottle() and throttledWarning()
Diffstat (limited to 'src/nxmaccessmanager.cpp')
| -rw-r--r-- | src/nxmaccessmanager.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/nxmaccessmanager.cpp b/src/nxmaccessmanager.cpp index 684a53fa..5886d3ee 100644 --- a/src/nxmaccessmanager.cpp +++ b/src/nxmaccessmanager.cpp @@ -18,8 +18,8 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. */ #include "nxmaccessmanager.h" - #include "iplugingame.h" +#include "nexusinterface.h" #include "nxmurl.h" #include "report.h" #include "utility.h" @@ -280,14 +280,11 @@ void NXMAccessManager::validateFinished() QString name = credentialsData.value("name").toString(); bool premium = credentialsData.value("is_premium").toBool(); - std::tuple<int, int, int, int> limits(std::make_tuple( - m_ValidateReply->rawHeader("x-rl-daily-remaining").toInt(), - m_ValidateReply->rawHeader("x-rl-daily-limit").toInt(), - m_ValidateReply->rawHeader("x-rl-hourly-remaining").toInt(), - m_ValidateReply->rawHeader("x-rl-hourly-limit").toInt() - )); - - emit credentialsReceived(name, id, premium, limits); + emit credentialsReceived(APIUserAccount() + .id(QString("%1").arg(id)) + .name(name) + .type(premium ? APIUserAccountTypes::Premium : APIUserAccountTypes::Regular) + .limits(NexusInterface::parseLimits(m_ValidateReply))); m_ValidateReply->deleteLater(); m_ValidateReply = nullptr; |
