| 146 | } |
| 147 | |
| 148 | bool |
| 149 | CancellableController::process(QString const &name, CancellableTask *task) |
| 150 | { |
| 151 | // Going to delete it nonetheless |
| 152 | if (this->doneReceived) |
| 153 | this->deleteTask(); |
| 154 | |
| 155 | if (this->task != nullptr) |
| 156 | return false; |
| 157 | |
| 158 | this->name = name; |
| 159 | this->task = task; |
| 160 | this->cancelledState = false; |
| 161 | this->doneReceived = false; |
| 162 | |
| 163 | emit progress(task->getProgress(), task->getStatus()); |
| 164 | |
| 165 | task->moveToThread(&this->worker); |
| 166 | |
| 167 | this->connectTask(); |
| 168 | |
| 169 | emit queuedWork(); |
| 170 | |
| 171 | return true; |
| 172 | } |
| 173 | |
| 174 | bool |
| 175 | CancellableController::cancel(void) |
no test coverage detected