From 8fc9bc97f509cb7e637eb4e3e118c68c3022ac2f 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: Sat, 7 Sep 2019 17:17:25 +0800 Subject: Separated the function to get the task list --- worker.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'worker.cxx') diff --git a/worker.cxx b/worker.cxx index b3c42aa..df0e832 100644 --- a/worker.cxx +++ b/worker.cxx @@ -1,4 +1,6 @@ +#include #include "rtclient.h" +#include "user.hxx" #include "worker.hxx" Worker::Worker(QObject* parent) : @@ -9,10 +11,19 @@ Worker::Worker(QObject* parent) : void Worker::logIn(QString const& name, QString const& password) { + auto engine = dynamic_cast(this->parent()); + auto user = engine->singletonInstance(User::typeId); + user->setName(name); rtclient_login(name.toLatin1().constData(), password.toLatin1().constData()); rtclient_user(name.toLatin1().constData()); +} + +void Worker::getTaskList() +{ + auto engine = dynamic_cast(this->parent()); + auto user = engine->singletonInstance(User::typeId); QString query{"Owner='"}; - query.append(name); + query.append(user->name()); query.append("'"); rtclient_search(query.toLatin1().constData()); } -- cgit v1.2.3