| 19 | } |
| 20 | |
| 21 | void DataMigrationTask::executeTask() |
| 22 | { |
| 23 | setStatus(tr("Scanning files...")); |
| 24 | |
| 25 | // 1. Scan |
| 26 | // Check how many files we gotta copy |
| 27 | m_copyFuture = QtConcurrent::run(QThreadPool::globalInstance(), [&] { |
| 28 | return m_copy(true); // dry run to collect amount of files |
| 29 | }); |
| 30 | connect(&m_copyFutureWatcher, &QFutureWatcher<bool>::finished, this, &DataMigrationTask::dryRunFinished); |
| 31 | connect(&m_copyFutureWatcher, &QFutureWatcher<bool>::canceled, this, &DataMigrationTask::dryRunAborted); |
| 32 | m_copyFutureWatcher.setFuture(m_copyFuture); |
| 33 | } |
| 34 | |
| 35 | void DataMigrationTask::dryRunFinished() |
| 36 | { |