summaryrefslogtreecommitdiff
path: root/qrtclient
diff options
context:
space:
mode:
Diffstat (limited to 'qrtclient')
-rw-r--r--qrtclient/ticket.hxx17
-rw-r--r--qrtclient/tickethistory.hxx23
-rw-r--r--qrtclient/user.hxx4
3 files changed, 19 insertions, 25 deletions
diff --git a/qrtclient/ticket.hxx b/qrtclient/ticket.hxx
index 080a296..6e3d0eb 100644
--- a/qrtclient/ticket.hxx
+++ b/qrtclient/ticket.hxx
@@ -3,9 +3,6 @@
#include <QAbstractListModel>
#include <rtclient/ticket.h>
-#include <rtclient/search.h>
-
-struct rtclient_search_ticket_list;
namespace RTClient {
@@ -34,8 +31,12 @@ class TicketList : public QAbstractListModel
SubjectRole
};
- explicit TicketList(QObject* parent = nullptr)
- : QAbstractListModel{parent} {}
+ TicketList(QObject* parent = nullptr)
+ : QAbstractListModel{parent} {}
+ TicketList(struct rtclient_ticket** list,
+ QObject* parent = nullptr);
+ TicketList(TicketList const& list) { tickets = list.tickets; }
+ ~TicketList() {}
int rowCount(QModelIndex const& parent
= QModelIndex()) const Q_DECL_OVERRIDE;
@@ -46,14 +47,12 @@ class TicketList : public QAbstractListModel
protected:
QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE;
- signals:
- void updated();
- void rowCountChanged();
-
private:
QList<Ticket> tickets;
};
}
+Q_DECLARE_METATYPE(RTClient::TicketList)
+
#endif
diff --git a/qrtclient/tickethistory.hxx b/qrtclient/tickethistory.hxx
index effe9f1..bfc77ac 100644
--- a/qrtclient/tickethistory.hxx
+++ b/qrtclient/tickethistory.hxx
@@ -5,8 +5,6 @@
#include <QDateTime>
#include <rtclient/ticket.h>
-struct rtclient_ticket_history_list;
-
namespace RTClient {
class TicketHistory
@@ -63,7 +61,6 @@ class TicketHistory
class TicketHistoryList : public QAbstractListModel
{
Q_OBJECT
- Q_PROPERTY(int rowCount READ rowCount NOTIFY rowCountChanged)
public:
enum TicketHistoryRoles {
@@ -82,8 +79,15 @@ class TicketHistoryList : public QAbstractListModel
AttachmentsRole*/
};
- explicit TicketHistoryList(QObject* parent = nullptr)
- : QAbstractListModel{parent} {}
+ TicketHistoryList(QObject* parent = nullptr)
+ : QAbstractListModel{parent} {}
+ TicketHistoryList(struct rtclient_ticket_history** list,
+ QObject* parent = nullptr);
+ TicketHistoryList(TicketHistoryList const& list)
+ {
+ histories = list.histories;
+ }
+ ~TicketHistoryList() {}
int rowCount(QModelIndex const& parent
= QModelIndex()) const Q_DECL_OVERRIDE;
@@ -91,20 +95,15 @@ class TicketHistoryList : public QAbstractListModel
int role = Qt::DisplayRole
) const Q_DECL_OVERRIDE;
- public slots:
- void update(rtclient_ticket_history_list* list);
-
protected:
QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE;
- signals:
- void rowCountChanged();
- void updated();
-
private:
QList<TicketHistory> histories;
};
}
+Q_DECLARE_METATYPE(RTClient::TicketHistoryList)
+
#endif
diff --git a/qrtclient/user.hxx b/qrtclient/user.hxx
index d258820..d76b8e4 100644
--- a/qrtclient/user.hxx
+++ b/qrtclient/user.hxx
@@ -4,8 +4,6 @@
#include <QObject>
#include <rtclient/user.h>
-struct rtclient_user;
-
namespace RTClient {
class User : public QObject
@@ -121,8 +119,6 @@ class User : public QObject
void setTimeZone(rtclient_user_timezone timezone);
void setPrivileged(bool privileged);
void setDisabled(bool disabled);
- public slots:
- void update(rtclient_user* user);
signals:
void idChanged();