diff options
Diffstat (limited to 'qrtclient')
| -rw-r--r-- | qrtclient/client.hxx | 1 | ||||
| -rw-r--r-- | qrtclient/ticket.hxx | 17 | ||||
| -rw-r--r-- | qrtclient/user.hxx | 6 | 
3 files changed, 16 insertions, 8 deletions
diff --git a/qrtclient/client.hxx b/qrtclient/client.hxx index 75477d7..cf7cba9 100644 --- a/qrtclient/client.hxx +++ b/qrtclient/client.hxx @@ -60,6 +60,7 @@ namespace RTClient {  					, QString const& due = nullptr  					, QString const& text = nullptr);  			void ticketSearch(QString const& owner); +			void ticketHistory(int id);  		signals:  			void loggedIn(QString const& name); diff --git a/qrtclient/ticket.hxx b/qrtclient/ticket.hxx index 2ad8008..25c067f 100644 --- a/qrtclient/ticket.hxx +++ b/qrtclient/ticket.hxx @@ -2,6 +2,7 @@  #define QRTCLIENT_TICKET_HXX  #include <QAbstractListModel> +#include <rtclient/ticket.h>  struct rtclient_ticketlist; @@ -10,10 +11,15 @@ namespace RTClient {  	class Ticket  	{  		public: -			Ticket(QString subject) : m_subject{subject} {} +			Ticket(rtclient_ticket* ticket) +				: m_id{ticket->id} +				, m_subject{ticket->subject} +			{} +			unsigned int id() const { return m_id; }  			QString const& subject() const { return m_subject; }  		private: +			unsigned int m_id;  			QString m_subject;  	}; @@ -24,7 +30,8 @@ namespace RTClient {  		public:  			enum TicketRoles { -				SubjectRole = Qt::UserRole + 1, +				IdRole = Qt::UserRole + 1, +				SubjectRole  			};  			explicit TicketList(QObject* parent = nullptr) @@ -36,6 +43,9 @@ namespace RTClient {  					, int role = Qt::DisplayRole  					) const Q_DECL_OVERRIDE; +		public slots: +			void update(rtclient_ticketlist* ticketList); +  		protected:  			QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE; @@ -43,9 +53,6 @@ namespace RTClient {  			void updated();  			void rowCountChanged(); -		private slots: -			void update(rtclient_ticketlist* ticketList); -  		private:  			QList<Ticket> tickets;  			void addTicket(Ticket const& ticket); diff --git a/qrtclient/user.hxx b/qrtclient/user.hxx index 0d2b6ac..5b692a6 100644 --- a/qrtclient/user.hxx +++ b/qrtclient/user.hxx @@ -120,6 +120,9 @@ namespace RTClient {  			void setPrivileged(bool privileged);  			void setDisabled(bool disabled); +		public slots: +			void update(rtclient_user* user); +  		signals:  			void idChanged();  			void nameChanged(); @@ -147,9 +150,6 @@ namespace RTClient {  			void privilegedChanged();  			void disabledChanged(); -		private slots: -			void update(rtclient_user* user); -  		private:  			unsigned int m_id;  			QString m_name;  |