From 9ec42c7e9c4a96d54bbf526cbd93f07c78e2415e 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: Fri, 13 Sep 2019 18:29:31 +0800 Subject: Manage to show tasks but the view is widened vertically yet. --- worker.cxx | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'worker.cxx') diff --git a/worker.cxx b/worker.cxx index e21ef6b..c472212 100644 --- a/worker.cxx +++ b/worker.cxx @@ -1,6 +1,3 @@ -#ifdef DEBUG -#include -#endif // DEBUG #include "rtclient.h" #include "worker.hxx" @@ -12,7 +9,7 @@ Worker::Worker() void Worker::logIn(QString const& name, QString const& password) { rtclient_login(name.toLatin1().constData(), password.toLatin1().constData()); - struct rt_user *user = NULL; + struct rt_user* user = NULL; rtclient_userget(&user, name.toLatin1().constData()); if (user) emit logged(user); } @@ -22,18 +19,9 @@ void Worker::search(QString const& owner) QString query{"Owner='"}; query.append(owner); query.append("'"); - rt_ticketlist *tasks = NULL; - rtclient_search(&tasks, query.toLatin1().constData()); - if (tasks) { -#ifdef DEBUG - for (unsigned short i = 0; i < tasks->length; i++) { - auto task = tasks->tickets[i]; - qDebug() << "Task: " << task; - if (task) free(task); - } -#endif // DEBUG - free(tasks); - } + rt_ticketlist* taskList = NULL; + rtclient_search(&taskList, query.toLatin1().constData()); + if (taskList) emit foundTasks(taskList); } Worker::~Worker() -- cgit v1.2.3