diff options
author | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-09-13 17:17:22 +0800 |
---|---|---|
committer | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-09-13 17:17:58 +0800 |
commit | 7e4501b3af82360eb1415f3d5745f1b0c278f504 (patch) | |
tree | 3fa0448a7f8e0f1e1e4d8b8726984c89d0ecdb4f | |
parent | e519731cf3ff2c851b038beca1d8c12c59a33f55 (diff) |
rt_ticketlist struct with flexible array members
Manage to get tickets info to the app
m--------- | librtclient | 0 | ||||
-rw-r--r-- | worker.cxx | 16 |
2 files changed, 15 insertions, 1 deletions
diff --git a/librtclient b/librtclient -Subproject a7526494614abd16a8871b665704e2bda05440b +Subproject 2e207d07a6416d7ccb32040c3f9e43c3a48aeed @@ -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() |