diff options
Diffstat (limited to 'tasklist.cxx')
| -rw-r--r-- | tasklist.cxx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tasklist.cxx b/tasklist.cxx index 4810c5b..863ae23 100644 --- a/tasklist.cxx +++ b/tasklist.cxx @@ -14,8 +14,6 @@ QVariant TaskList::data(QModelIndex const& index, int role) const auto task = tasks[row]; switch (role) { - case IdRole: - return task.id(); case SubjectRole: return task.subject(); default: @@ -26,7 +24,6 @@ QVariant TaskList::data(QModelIndex const& index, int role) const QHash<int, QByteArray> TaskList::roleNames() const { return QHash<int, QByteArray>{ - {IdRole, "id"}, {SubjectRole, "subject"} }; } @@ -38,3 +35,13 @@ void TaskList::addTask(Task const& task) endInsertRows(); emit rowCountChanged(); } + +void TaskList::addTasks(rt_ticketlist* taskList) +{ + for (unsigned int i = 0; i < taskList->length; i++) { + auto task = taskList->tickets[i]; + addTask(Task{task}); + free(task); + } + free(taskList); +} |