| 95 | } |
| 96 | |
| 97 | void |
| 98 | CancellableController::connectTask(void) |
| 99 | { |
| 100 | // Signals from controller to task |
| 101 | connect( |
| 102 | this, |
| 103 | SIGNAL(queuedWork()), |
| 104 | this->task, |
| 105 | SLOT(onWorkRequested())); |
| 106 | |
| 107 | connect( |
| 108 | this, |
| 109 | SIGNAL(queuedCancel()), |
| 110 | this->task, |
| 111 | SLOT(onCancelRequested())); |
| 112 | |
| 113 | // Signals from task to controller |
| 114 | connect( |
| 115 | this->task, |
| 116 | SIGNAL(progress(qreal, QString)), |
| 117 | this, |
| 118 | SLOT(onProgress(qreal, QString))); |
| 119 | |
| 120 | connect( |
| 121 | this->task, |
| 122 | SIGNAL(done(void)), |
| 123 | this, |
| 124 | SLOT(onDone(void))); |
| 125 | |
| 126 | connect( |
| 127 | this->task, |
| 128 | SIGNAL(cancelled(void)), |
| 129 | this, |
| 130 | SLOT(onCancelled(void))); |
| 131 | |
| 132 | connect( |
| 133 | this->task, |
| 134 | SIGNAL(error(QString)), |
| 135 | this, |
| 136 | SLOT(onError(QString))); |
| 137 | } |
| 138 | |
| 139 | void |
| 140 | CancellableController::deleteTask(void) |