| 214 | } |
| 215 | |
| 216 | void TaskModel::removeTask(const Task &task) |
| 217 | { |
| 218 | int index = allTasks.indexOf(task); |
| 219 | if (index >= 0) { |
| 220 | const Task &t = allTasks.at(index); |
| 221 | |
| 222 | beginRemoveRows(QModelIndex(), index, index); |
| 223 | categories[task.category].removeTask(t); |
| 224 | categories[Core::Id()].removeTask(t); |
| 225 | allTasks.removeAt(index); |
| 226 | endRemoveRows(); |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | void TaskModel::clearTasks(const QString &categoryId) |
| 231 | { |
no test coverage detected