diff options
| author | Jeremy Rimpo <jrim@rimpo.org> | 2019-07-22 01:02:21 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-22 01:02:21 -0500 |
| commit | 1f1b838c2b3fd3148d2c2a1a8fe6fcf9fb07383f (patch) | |
| tree | 33c20c0cc6e5f0029558c8e8383a0fdf68571689 /src/apiuseraccount.cpp | |
| parent | 613aa037cf8dc728eac474ee6cf6b790293d5114 (diff) | |
| parent | 2d78957c3d4c33de5813d7ee5b86dec8cb01478c (diff) | |
Merge pull request #796 from isanae/login-progress-dialog
Nexus login progress dialog and Nexus settings
Diffstat (limited to 'src/apiuseraccount.cpp')
| -rw-r--r-- | src/apiuseraccount.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/apiuseraccount.cpp b/src/apiuseraccount.cpp index b901e41a..35a868d5 100644 --- a/src/apiuseraccount.cpp +++ b/src/apiuseraccount.cpp @@ -1,10 +1,37 @@ #include "apiuseraccount.h" +QString localizedUserAccountType(APIUserAccountTypes t) +{ + switch (t) + { + case APIUserAccountTypes::Regular: + return QObject::tr("Regular"); + + case APIUserAccountTypes::Premium: + return QObject::tr("Premium"); + + case APIUserAccountTypes::None: // fall-through + default: + return QObject::tr("None"); + } +} + + APIUserAccount::APIUserAccount() : m_type(APIUserAccountTypes::None) { } +bool APIUserAccount::isValid() const +{ + return !m_key.isEmpty(); +} + +const QString& APIUserAccount::apiKey() const +{ + return m_key; +} + const QString& APIUserAccount::id() const { return m_id; @@ -25,6 +52,12 @@ const APILimits& APIUserAccount::limits() const return m_limits; } +APIUserAccount& APIUserAccount::apiKey(const QString& key) +{ + m_key = key; + return *this; +} + APIUserAccount& APIUserAccount::id(const QString& id) { m_id = id; |
