summaryrefslogtreecommitdiff
path: root/controller.cxx
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-26 22:36:38 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-26 22:36:38 +0800
commit15cea436fc49d34a379a2faf9fe2394f5369a4cf (patch)
tree16f20813df9caac2b339f12b39cc4f88560a3067 /controller.cxx
parent7cb77ba2cb6f22b0ec859d06a21070de680a4672 (diff)
Controller triggers the user update directly
Diffstat (limited to 'controller.cxx')
-rw-r--r--controller.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/controller.cxx b/controller.cxx
index 40eee0d..43e7652 100644
--- a/controller.cxx
+++ b/controller.cxx
@@ -37,7 +37,7 @@ Controller::Controller(QObject* parent) : QObject{parent}
Q_UNUSED(scriptEngine)
return new User;
});
- auto user = engine->singletonInstance<User*>(typeId);
+ auto qUser = engine->singletonInstance<User*>(typeId);
using RTClient::TicketList;
taskList = new TicketList;
@@ -50,16 +50,13 @@ Controller::Controller(QObject* parent) : QObject{parent}
, client, static_cast<void (Client::*)(QString const&)>
(&Client::userShow));
- connect(client, &Client::userShown, [this](rtclient_user* user) {
+ connect(client, &Client::userShown, [this,qUser](rtclient_user* user) {
if (user) {
emit checked(QString{user->name});
- emit checked(user);
+ qUser->update(user);
}
});
- connect(this, static_cast<void (Controller::*)(rtclient_user*)>
- (&Controller::checked)
- , user, &User::update);
connect(this, static_cast<void (Controller::*)(QString const&)>
(&Controller::checked)
, client, &Client::ticketSearch);