From e721999f09176efe9a9947555095904fafcbaa4f 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, 14 Sep 2019 07:22:51 +0800 Subject: Use rtclient_ticketsfree to free tickets --- librtclient | 2 +- tasklist.cxx | 11 ++++------- worker.cxx | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/librtclient b/librtclient index e9561a9..4ccd288 160000 --- a/librtclient +++ b/librtclient @@ -1 +1 @@ -Subproject commit e9561a9bd14469edab70886d98e050bfe054a3eb +Subproject commit 4ccd288909c6a9f1fe47ae72744ffba6f0ef410e diff --git a/tasklist.cxx b/tasklist.cxx index 6bc7c4b..fd7e4b5 100644 --- a/tasklist.cxx +++ b/tasklist.cxx @@ -1,4 +1,4 @@ -#include "rtticket.h" +#include "rtclient.h" #include "tasklist.hxx" int TaskList::rowCount(QModelIndex const& parent) const @@ -39,10 +39,7 @@ void TaskList::addTask(Task const& task) void TaskList::addTasks(rt_ticketlist* taskList) { - for (unsigned int i = 0; i < taskList->length; i++) { - auto task = taskList->tickets[i]; - addTask(Task{task}); - free(task); - } - free(taskList); + for (unsigned int i = 0; i < taskList->length; i++) + addTask(Task{taskList->tickets[i]}); + rtclient_ticketsfree(taskList); } diff --git a/worker.cxx b/worker.cxx index c472212..767ee9d 100644 --- a/worker.cxx +++ b/worker.cxx @@ -20,7 +20,7 @@ void Worker::search(QString const& owner) query.append(owner); query.append("'"); rt_ticketlist* taskList = NULL; - rtclient_search(&taskList, query.toLatin1().constData()); + rtclient_ticketssearch(&taskList, query.toLatin1().constData()); if (taskList) emit foundTasks(taskList); } -- cgit v1.2.3