From 232dd5211cd30774274cbbfc971b3489a8bcf200 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=20=EA=A6=AB=EA=A6=B6=20=EA=A6=8F=EA=A7=80?= =?UTF-8?q?=EA=A6=A6=EA=A6=BF=20=EA=A6=A7=20=EA=A6=AE=20=EA=A6=91=20?= =?UTF-8?q?=EA=A6=A9=20=EA=A6=AD=EA=A7=80?= Date: Sat, 5 Oct 2019 14:51:36 +0800 Subject: updated signal is emitted only when the list *is* updated --- ticket.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ticket.cxx') diff --git a/ticket.cxx b/ticket.cxx index 4693225..7b21bc8 100644 --- a/ticket.cxx +++ b/ticket.cxx @@ -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(); } } -- cgit v1.2.3