| 181 | } |
| 182 | |
| 183 | QList<Task> TaskModel::tasks(const QString &categoryId) const |
| 184 | { |
| 185 | if (categoryId.isEmpty()) |
| 186 | return allTasks; |
| 187 | |
| 188 | QList<Task> taskList; |
| 189 | foreach (const Task &t, allTasks) { |
| 190 | if (t.category == categoryId) |
| 191 | taskList.append(t); |
| 192 | } |
| 193 | return taskList; |
| 194 | } |
| 195 | |
| 196 | bool sortById(const Task &task, unsigned int id) |
| 197 | { |