From 41bfcb06c9c0ff97ab69f323e96117b46529828b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=20=EA=A6=AB=EA=A6=B6=20=EA=A6=8F=EA=A7=80?= =?UTF-8?q?=EA=A6=A6=EA=A6=BF=20=EA=A6=A7=20=EA=A6=AE=20=EA=A6=91=20?= =?UTF-8?q?=EA=A6=A9=20=EA=A6=AD=EA=A7=80?= Date: Sun, 15 Sep 2019 20:05:18 +0800 Subject: qrtclient as submodule instead while librtclient has become qrtclient's submodule --- tasklist.cxx | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 tasklist.cxx (limited to 'tasklist.cxx') diff --git a/tasklist.cxx b/tasklist.cxx deleted file mode 100644 index d972773..0000000 --- a/tasklist.cxx +++ /dev/null @@ -1,45 +0,0 @@ -#include -#include "tasklist.hxx" - -int TaskList::rowCount(QModelIndex const& parent) const -{ - Q_UNUSED(parent) - return tasks.count(); -} - -QVariant TaskList::data(QModelIndex const& index, int role) const -{ - auto row = index.row(); - - if (row < 0 || row >= tasks.count()) return QVariant(); - - auto task = tasks[row]; - switch (role) { - case SubjectRole: - return task.subject(); - default: - return QVariant(); - } -} - -QHash TaskList::roleNames() const -{ - return QHash{ - {SubjectRole, "subject"} - }; -} - -void TaskList::addTask(Task const& task) -{ - beginInsertRows(QModelIndex(), rowCount(), rowCount()); - tasks << task; - endInsertRows(); - emit rowCountChanged(); -} - -void TaskList::addTasks(rt_ticketlist* taskList) -{ - for (unsigned int i = 0; i < taskList->length; i++) - addTask(Task{taskList->tickets[i]}); - rtclient_ticket_freelist(taskList); -} -- cgit v1.2.3