summaryrefslogtreecommitdiff
path: root/ticket.cxx
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-02-02 11:43:30 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-02-02 11:43:30 +0800
commit1109e60984fe411f2f75cceb6e53966286c833aa (patch)
tree013912a319701d9188f480a81880e3dbaedf4cf3 /ticket.cxx
parent5b650c5f483ff98cea125606372ef433c53fc2a7 (diff)
Reindent
Diffstat (limited to 'ticket.cxx')
-rw-r--r--ticket.cxx53
1 files changed, 26 insertions, 27 deletions
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<int, QByteArray> TicketList::roleNames() const
- {
- return QHash<int, QByteArray>{
- {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<int, QByteArray> TicketList::roleNames() const
+{
+ return QHash<int, QByteArray>{{IdRole, "id"},
+ {SubjectRole, "subject"}
+ };
+}
void TicketList::addTicket(Ticket const& ticket)
{