summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-19 18:22:41 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-19 18:22:41 +0800
commit61c312c1e059b97ff131d375af78c7362bb0fc5a (patch)
tree7a7734c41832786a5842450ed9cbea95e314f740
parent0b05904d38acb050ead71ad256d59f70b9c9fe87 (diff)
Separated userShow from logIn
Each emitting different signals
-rw-r--r--client.cxx18
m---------librtclient0
-rw-r--r--qrtclient/client.hxx5
3 files changed, 19 insertions, 4 deletions
diff --git a/client.cxx b/client.cxx
index bef315f..9a2fc51 100644
--- a/client.cxx
+++ b/client.cxx
@@ -11,9 +11,7 @@ namespace RTClient {
void Client::logIn(QString const& name, QString const& password)
{
rtclient_login(name.toLatin1().constData(), password.toLatin1().constData());
- rtclient_user* user = NULL;
- rtclient_user_show(&user, name.toLatin1().constData());
- if (user) emit logged(user);
+ emit loggedIn(name);
}
void Client::userNew(QString const& name
@@ -67,6 +65,20 @@ namespace RTClient {
, privileged);
}
+ void Client::userShow(unsigned int id)
+ {
+ rtclient_user* user = NULL;
+ rtclient_user_showid(&user, id);
+ if (user) emit userShown(user);
+ }
+
+ void Client::userShow(QString const& name)
+ {
+ rtclient_user* user = NULL;
+ rtclient_user_showname(&user, name.toLatin1().constData());
+ if (user) emit userShown(user);
+ }
+
void Client::ticketNew(QString const& queue
, QString const& requestor
, QString const& subject
diff --git a/librtclient b/librtclient
-Subproject ab08c615c706cb95fe95ad83c108856a03be238
+Subproject 7b6b765ec2a7322e9d9bae8ecd5f7775325d5e7
diff --git a/qrtclient/client.hxx b/qrtclient/client.hxx
index 2cdccd2..08f5b29 100644
--- a/qrtclient/client.hxx
+++ b/qrtclient/client.hxx
@@ -43,6 +43,8 @@ namespace RTClient {
, rtclient_timezone timeZone = RTCLIENT_TIMEZONE_NONE
, bool disabled = false
, bool privileged = false);
+ void userShow(unsigned int id);
+ void userShow(QString const& name);
void ticketNew(QString const& queue = nullptr
, QString const& requestor = nullptr
, QString const& subject = nullptr
@@ -60,7 +62,8 @@ namespace RTClient {
void ticketSearch(QString const& owner);
signals:
- void logged(rtclient_user* user);
+ void loggedIn(QString const& name);
+ void userShown(rtclient_user* user);
void foundTickets(rtclient_ticketlist* list);
};