blob: 2f30b49b1d2c74dbfc600bc606fc76f885d16a12 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#include <rtclient/client.h>
#include "qrtclient/client.hxx"
namespace RTClient {
Client::Client(QString const& url)
{
rtclient_init(url.toLatin1().constData());
}
void Client::logIn(QString const& name, QString const& password)
{
rtclient_login(name.toLatin1().constData(), password.toLatin1().constData());
struct rt_user* user = NULL;
rtclient_user_show(&user, name.toLatin1().constData());
if (user) emit logged(user);
}
void Client::search(QString const& owner)
{
QString query{"Owner='"};
query.append(owner);
query.append("'");
rt_ticketlist* taskList = NULL;
rtclient_ticket_search(&taskList, query.toLatin1().constData());
if (taskList) emit foundTasks(taskList);
}
Client::~Client()
{
rtclient_cleanup();
}
}
|