summaryrefslogtreecommitdiff
path: root/tasklist.cxx
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-13 18:29:31 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-13 18:29:31 +0800
commit9ec42c7e9c4a96d54bbf526cbd93f07c78e2415e (patch)
tree422e087574a93d29edf689189c23b0949d4a3449 /tasklist.cxx
parent7e4501b3af82360eb1415f3d5745f1b0c278f504 (diff)
Manage to show tasks
but the view is widened vertically yet.
Diffstat (limited to 'tasklist.cxx')
-rw-r--r--tasklist.cxx13
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);
+}