summaryrefslogtreecommitdiff
path: root/worker.cxx
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-07 17:17:25 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-07 17:17:25 +0800
commit8fc9bc97f509cb7e637eb4e3e118c68c3022ac2f (patch)
tree2e7e3b665d0b613183a810a7fec2154748f3d593 /worker.cxx
parent16bc24b796de76ec1a5fa66dcfe2129a2b02d370 (diff)
Separated the function to get the task list
Diffstat (limited to 'worker.cxx')
-rw-r--r--worker.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/worker.cxx b/worker.cxx
index b3c42aa..df0e832 100644
--- a/worker.cxx
+++ b/worker.cxx
@@ -1,4 +1,6 @@
+#include <QQmlApplicationEngine>
#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<QQmlApplicationEngine*>(this->parent());
+ auto user = engine->singletonInstance<User*>(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<QQmlApplicationEngine*>(this->parent());
+ auto user = engine->singletonInstance<User*>(User::typeId);
QString query{"Owner='"};
- query.append(name);
+ query.append(user->name());
query.append("'");
rtclient_search(query.toLatin1().constData());
}