summaryrefslogtreecommitdiff
path: root/worker.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'worker.cxx')
-rw-r--r--worker.cxx20
1 files changed, 4 insertions, 16 deletions
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 <QDebug>
-#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()