summaryrefslogtreecommitdiff
path: root/interchange
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-05-09 13:17:19 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-05-09 13:17:19 +0800
commit3fc49f2f2838c69be14bcf60c6cf756825b2bbee (patch)
treeb634befd1f3d6656afda18c7bd08299130dec05e /interchange
parent438bcd2d5fc49fdeec642f06647a7a7ee758f6f6 (diff)
Constructor using C version, & no setData
Diffstat (limited to 'interchange')
-rw-r--r--interchange/admin.hxx18
1 files changed, 8 insertions, 10 deletions
diff --git a/interchange/admin.hxx b/interchange/admin.hxx
index 4642e76..f9abdb2 100644
--- a/interchange/admin.hxx
+++ b/interchange/admin.hxx
@@ -17,15 +17,11 @@ namespace QInterchange {
Q_PROPERTY(bool super READ super WRITE setSuper NOTIFY superChanged)
public:
- explicit Admin(QObject* parent = nullptr) :
- QObject{parent},
- m_userName{""},
- m_password{""},
- m_name{""},
- m_super{false},
- m_data{nullptr}
- {}
+ explicit Admin(QObject *parent = nullptr);
+ explicit Admin(struct interchange_admin admin,
+ QObject *parent = nullptr);
~Admin() {}
+
QString const& userName() const { return m_userName; }
QString const& password() const { return m_password; }
QString const& name() const { return m_name; }
@@ -49,18 +45,20 @@ namespace QInterchange {
void logOut();
signals:
+ void loggedIn(const QString &response);
void userNameChanged();
void passwordChanged();
void nameChanged();
void superChanged();
+ protected:
+ void emitLogin(const QString &response);
+
private:
QString m_userName;
QString m_password;
QString m_name;
bool m_super;
- interchange_admin* m_data;
- inline void setData(interchange_admin* data);
};
}