summaryrefslogtreecommitdiff
path: root/ticket.cxx
diff options
context:
space:
mode:
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)
{