From 15cea436fc49d34a379a2faf9fe2394f5369a4cf 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, 26 Sep 2019 22:36:38 +0800 Subject: Controller triggers the user update directly --- controller.cxx | 9 +++------ 1 file 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(typeId); + auto qUser = engine->singletonInstance(typeId); using RTClient::TicketList; taskList = new TicketList; @@ -50,16 +50,13 @@ Controller::Controller(QObject* parent) : QObject{parent} , client, static_cast (&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 - (&Controller::checked) - , user, &User::update); connect(this, static_cast (&Controller::checked) , client, &Client::ticketSearch); -- cgit v1.2.3