From 61c312c1e059b97ff131d375af78c7362bb0fc5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=20=EA=A6=AB=EA=A6=B6=20=EA=A6=8F=EA=A7=80?= =?UTF-8?q?=EA=A6=A6=EA=A6=BF=20=EA=A6=A7=20=EA=A6=AE=20=EA=A6=91=20?= =?UTF-8?q?=EA=A6=A9=20=EA=A6=AD=EA=A7=80?= Date: Thu, 19 Sep 2019 18:22:41 +0800 Subject: Separated userShow from logIn Each emitting different signals --- client.cxx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'client.cxx') 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 -- cgit v1.2.3