diff options
-rw-r--r-- | client.cxx | 6 | ||||
m--------- | librtclient | 0 | ||||
-rw-r--r-- | qrtclient/ticket.hxx | 2 | ||||
-rw-r--r-- | qrtclient/tickethistory.hxx | 2 | ||||
-rw-r--r-- | ticket.cxx | 12 | ||||
-rw-r--r-- | tickethistory.cxx | 2 |
6 files changed, 13 insertions, 11 deletions
@@ -116,9 +116,9 @@ namespace RTClient { void Client::searchTicket(QString const& owner) { QString query{"Owner='" % owner % "'"}; - rtclient_search_ticket_list* ticketList = nullptr; - rtclient_search_ticket(&ticketList, query.toLatin1().constData()); - emit searchedTicket(ticketList); + rtclient_search_ticket_list* list = nullptr; + rtclient_search_ticket(&list, query.toLatin1().constData()); + emit searchedTicket(list); } void Client::ticketHistory(int id, bool longFormat) diff --git a/librtclient b/librtclient -Subproject 601251148de5bd8a42649e3b888d7824eb1d774 +Subproject 280d890edd60196c496f92f969ab31e5ecbcaa0 diff --git a/qrtclient/ticket.hxx b/qrtclient/ticket.hxx index d02954b..44f5a08 100644 --- a/qrtclient/ticket.hxx +++ b/qrtclient/ticket.hxx @@ -45,7 +45,7 @@ namespace RTClient { ) const Q_DECL_OVERRIDE; public slots: - void update(rtclient_search_ticket_list* ticketList); + void update(rtclient_search_ticket_list* list); protected: QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE; diff --git a/qrtclient/tickethistory.hxx b/qrtclient/tickethistory.hxx index 7d68652..2d766f6 100644 --- a/qrtclient/tickethistory.hxx +++ b/qrtclient/tickethistory.hxx @@ -63,6 +63,7 @@ namespace RTClient { class TicketHistoryList : public QAbstractListModel { Q_OBJECT + Q_PROPERTY(int rowCount READ rowCount NOTIFY rowCountChanged) public: enum TicketHistoryRoles { @@ -97,6 +98,7 @@ namespace RTClient { QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE; signals: + void rowCountChanged(); void updated(); private: @@ -42,14 +42,14 @@ namespace RTClient { emit rowCountChanged(); } - void TicketList::update(rtclient_search_ticket_list* ticketList) + void TicketList::update(rtclient_search_ticket_list* list) { - if (ticketList) { - for (size_t i = 0; i < ticketList->length; i++) - addTicket(Ticket{ticketList->tickets[i]}); - rtclient_search_ticket_free(ticketList); + if (list) { + for (size_t i = 0; i < list->length; i++) + addTicket(Ticket{list->tickets[i]}); + rtclient_search_ticket_free(list); + emit updated(); } - emit updated(); } } diff --git a/tickethistory.cxx b/tickethistory.cxx index 4243d7c..80fc478 100644 --- a/tickethistory.cxx +++ b/tickethistory.cxx @@ -83,8 +83,8 @@ namespace RTClient { addTicketHistory (TicketHistory{list->histories[i]}); rtclient_ticket_history_list_free(list); + emit updated(); } - emit updated(); } } |