summaryrefslogtreecommitdiff
path: root/user.hxx
diff options
context:
space:
mode:
authorErik Prabowo Kamal <erik@darapsa.co.id>2019-08-30 15:41:40 +0800
committerErik Prabowo Kamal <erik@darapsa.co.id>2019-08-30 15:41:40 +0800
commit5607c8dbc6ba69f17b12579f7aad8cb028e33ce4 (patch)
tree5e2556edd6a2d5018f4a2e246d80472d39025941 /user.hxx
parent55a2bf601f0c1633f7955fd7ac52c98a8917af64 (diff)
Made the user class members more straightforward
using rtclient's rt_user members.
Diffstat (limited to 'user.hxx')
-rw-r--r--user.hxx57
1 files changed, 19 insertions, 38 deletions
diff --git a/user.hxx b/user.hxx
index 1cac5fe..98d5f68 100644
--- a/user.hxx
+++ b/user.hxx
@@ -2,8 +2,7 @@
#define USER_HXX
#include <QObject>
-
-struct rt_user;
+#include "rtuser.h"
class User : public QObject
{
@@ -34,25 +33,23 @@ class User : public QObject
{}
~User() {}
- Q_INVOKABLE void update(rt_user* user);
-
- QString const& name() const { return m_name; }
- QString const& emailAddress() const { return m_emailAddress; }
- QString const& organization() const { return m_organization; }
- QString const& realName() const { return m_realName; }
- QString const& nickName() const { return m_nickName; }
- QString const& lang() const { return m_lang; }
- QString const& homePhone() const { return m_homePhone; }
- QString const& workPhone() const { return m_workPhone; }
- QString const& mobilePhone() const { return m_mobilePhone; }
- QString const& pagerPhone() const { return m_pagerPhone; }
- QString const& address1() const { return m_address1; }
- QString const& address2() const { return m_address2; }
- QString const& city() const { return m_city; }
- QString const& state() const { return m_state; }
- QString const& zip() const { return m_zip; }
- QString const& country() const { return m_country; }
- QString const& timeZone() const { return m_timeZone; }
+ QString const name() const { return QString{m_user.name}; }
+ QString const emailAddress() const { return QString{m_user.emailaddress}; }
+ QString const organization() const { return QString{m_user.organization}; }
+ QString const realName() const { return QString{m_user.realname}; }
+ QString const nickName() const { return QString{m_user.nickname}; }
+ QString const lang() const { return QString{m_user.lang}; }
+ QString const homePhone() const { return QString{m_user.homephone}; }
+ QString const workPhone() const { return QString{m_user.workphone}; }
+ QString const mobilePhone() const { return QString{m_user.mobilephone}; }
+ QString const pagerPhone() const { return QString{m_user.pagerphone}; }
+ QString const address1() const { return QString{m_user.address1}; }
+ QString const address2() const { return QString{m_user.address2}; }
+ QString const city() const { return QString{m_user.city}; }
+ QString const state() const { return QString{m_user.state}; }
+ QString const zip() const { return QString{m_user.zip}; }
+ QString const country() const { return QString{m_user.country}; }
+ QString const timeZone() const { return QString{m_user.timezone}; }
bool isLoggedIn() const { return m_isLoggedIn; }
void setName(QString const& name);
@@ -95,23 +92,7 @@ class User : public QObject
void loggedInChanged();
private:
- QString m_name;
- QString m_emailAddress;
- QString m_organization;
- QString m_realName;
- QString m_nickName;
- QString m_lang;
- QString m_homePhone;
- QString m_workPhone;
- QString m_mobilePhone;
- QString m_pagerPhone;
- QString m_address1;
- QString m_address2;
- QString m_city;
- QString m_state;
- QString m_zip;
- QString m_country;
- QString m_timeZone;
+ rt_user m_user;
bool m_isLoggedIn;
};