summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-14 07:22:51 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-14 07:22:51 +0800
commite721999f09176efe9a9947555095904fafcbaa4f (patch)
tree3a767468d4cf8cc67b92547d2a540552ade97038
parent054903284b0f4771df121bdc4615b2079b5a9042 (diff)
Use rtclient_ticketsfree to free tickets
m---------librtclient0
-rw-r--r--tasklist.cxx11
-rw-r--r--worker.cxx2
3 files changed, 5 insertions, 8 deletions
diff --git a/librtclient b/librtclient
-Subproject e9561a9bd14469edab70886d98e050bfe054a3e
+Subproject 4ccd288909c6a9f1fe47ae72744ffba6f0ef410
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);
}