summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-13 17:17:22 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-13 17:17:58 +0800
commit7e4501b3af82360eb1415f3d5745f1b0c278f504 (patch)
tree3fa0448a7f8e0f1e1e4d8b8726984c89d0ecdb4f
parente519731cf3ff2c851b038beca1d8c12c59a33f55 (diff)
rt_ticketlist struct with flexible array members
Manage to get tickets info to the app
m---------librtclient0
-rw-r--r--worker.cxx16
2 files changed, 15 insertions, 1 deletions
diff --git a/librtclient b/librtclient
-Subproject a7526494614abd16a8871b665704e2bda05440b
+Subproject 2e207d07a6416d7ccb32040c3f9e43c3a48aeed
diff --git a/worker.cxx b/worker.cxx
index d5d3197..e21ef6b 100644
--- a/worker.cxx
+++ b/worker.cxx
@@ -1,3 +1,6 @@
+#ifdef DEBUG
+#include <QDebug>
+#endif // DEBUG
#include "rtclient.h"
#include "worker.hxx"
@@ -19,7 +22,18 @@ void Worker::search(QString const& owner)
QString query{"Owner='"};
query.append(owner);
query.append("'");
- rtclient_search(query.toLatin1().constData());
+ 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);
+ }
}
Worker::~Worker()