From 1109e60984fe411f2f75cceb6e53966286c833aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Wed, 2 Feb 2022 11:43:30 +0800 Subject: Reindent --- ticket.cxx | 53 ++++++++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 27 deletions(-) (limited to 'ticket.cxx') diff --git a/ticket.cxx b/ticket.cxx index 7b21bc8..e42207b 100644 --- a/ticket.cxx +++ b/ticket.cxx @@ -3,36 +3,35 @@ namespace RTClient { - int TicketList::rowCount(QModelIndex const& parent) const - { - Q_UNUSED(parent) - return tickets.count(); - } +int TicketList::rowCount(QModelIndex const& parent) const +{ + Q_UNUSED(parent) + return tickets.count(); +} - QVariant TicketList::data(QModelIndex const& index, int role) const - { - auto row = index.row(); - - if (row < 0 || row >= tickets.count()) return QVariant(); - - auto ticket = tickets[row]; - switch (role) { - case IdRole: - return ticket.id(); - case SubjectRole: - return ticket.subject(); - default: - return QVariant(); - } - } +QVariant TicketList::data(QModelIndex const& index, int role) const +{ + auto row = index.row(); - QHash TicketList::roleNames() const - { - return QHash{ - {IdRole, "id"} - , {SubjectRole, "subject"} - }; + if (row < 0 || row >= tickets.count()) return QVariant(); + + auto ticket = tickets[row]; + switch (role) { + case IdRole: + return ticket.id(); + case SubjectRole: + return ticket.subject(); + default: + return QVariant(); } +} + +QHash TicketList::roleNames() const +{ + return QHash{{IdRole, "id"}, + {SubjectRole, "subject"} + }; +} void TicketList::addTicket(Ticket const& ticket) { -- cgit v1.2.3