forked from qt-creator/qt-creator
TaskTree: Get rid of unneeded done handlers' arguments
Task-number: QTCREATORBUG-29834 Change-Id: I236dec27a292a1b006b7001d01ce620960380de9 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -266,7 +266,7 @@ private:
|
|||||||
process.setWriteData(m_writeData);
|
process.setWriteData(m_writeData);
|
||||||
connect(&process, &Process::started, this, [this] { emit started(); });
|
connect(&process, &Process::started, this, [this] { emit started(); });
|
||||||
};
|
};
|
||||||
const auto onDone = [this](const Process &, bool) {
|
const auto onDone = [this] {
|
||||||
delete m_writeBuffer;
|
delete m_writeBuffer;
|
||||||
m_writeBuffer = nullptr;
|
m_writeBuffer = nullptr;
|
||||||
};
|
};
|
||||||
@@ -278,7 +278,7 @@ private:
|
|||||||
async.setConcurrentCallData(localWrite, m_filePath, m_writeData, m_writeBuffer);
|
async.setConcurrentCallData(localWrite, m_filePath, m_writeData, m_writeBuffer);
|
||||||
emit started();
|
emit started();
|
||||||
};
|
};
|
||||||
const auto onDone = [this](const Async<void> &, bool) {
|
const auto onDone = [this] {
|
||||||
delete m_writeBuffer;
|
delete m_writeBuffer;
|
||||||
m_writeBuffer = nullptr;
|
m_writeBuffer = nullptr;
|
||||||
};
|
};
|
||||||
@@ -327,17 +327,17 @@ static Group interDeviceTransferTask(const FilePath &source, const FilePath &des
|
|||||||
SingleBarrier writerReadyBarrier;
|
SingleBarrier writerReadyBarrier;
|
||||||
TreeStorage<TransferStorage> storage;
|
TreeStorage<TransferStorage> storage;
|
||||||
|
|
||||||
const auto onReaderSetup = [=](FileStreamReader &reader) {
|
const auto onReaderSetup = [storage, source](FileStreamReader &reader) {
|
||||||
reader.setFilePath(source);
|
reader.setFilePath(source);
|
||||||
QTC_CHECK(storage->writer != nullptr);
|
QTC_CHECK(storage->writer != nullptr);
|
||||||
QObject::connect(&reader, &FileStreamReader::readyRead,
|
QObject::connect(&reader, &FileStreamReader::readyRead,
|
||||||
storage->writer, &FileStreamWriter::write);
|
storage->writer, &FileStreamWriter::write);
|
||||||
};
|
};
|
||||||
const auto onReaderDone = [=](const FileStreamReader &, bool) {
|
const auto onReaderDone = [storage] {
|
||||||
if (storage->writer) // writer may be deleted before the reader on TaskTree::stop().
|
if (storage->writer) // writer may be deleted before the reader on TaskTree::stop().
|
||||||
storage->writer->closeWriteChannel();
|
storage->writer->closeWriteChannel();
|
||||||
};
|
};
|
||||||
const auto onWriterSetup = [=](FileStreamWriter &writer) {
|
const auto onWriterSetup = [writerReadyBarrier, storage, destination](FileStreamWriter &writer) {
|
||||||
writer.setFilePath(destination);
|
writer.setFilePath(destination);
|
||||||
QObject::connect(&writer, &FileStreamWriter::started,
|
QObject::connect(&writer, &FileStreamWriter::started,
|
||||||
writerReadyBarrier->barrier(), &Barrier::advance);
|
writerReadyBarrier->barrier(), &Barrier::advance);
|
||||||
|
@@ -410,7 +410,7 @@ void TestRunner::runTestsHelper()
|
|||||||
qCInfo(runnerLog) << "Working directory:" << process.workingDirectory();
|
qCInfo(runnerLog) << "Working directory:" << process.workingDirectory();
|
||||||
qCDebug(runnerLog) << "Environment:" << process.environment().toStringList();
|
qCDebug(runnerLog) << "Environment:" << process.environment().toStringList();
|
||||||
};
|
};
|
||||||
const auto onProcessDone = [this, config, storage](const Process &process, bool) {
|
const auto onProcessDone = [this, config, storage](const Process &process) {
|
||||||
TestStorage *testStorage = storage.activeStorage();
|
TestStorage *testStorage = storage.activeStorage();
|
||||||
QTC_ASSERT(testStorage, return);
|
QTC_ASSERT(testStorage, return);
|
||||||
if (process.result() == ProcessResult::StartFailed) {
|
if (process.result() == ProcessResult::StartFailed) {
|
||||||
|
@@ -686,7 +686,7 @@ Group ClangTool::runRecipe(const RunSettings &runSettings,
|
|||||||
const auto onSetup = [runControl](QPointer<RunControl> &buildRunControl) {
|
const auto onSetup = [runControl](QPointer<RunControl> &buildRunControl) {
|
||||||
buildRunControl = runControl;
|
buildRunControl = runControl;
|
||||||
};
|
};
|
||||||
const auto onError = [this](const QPointer<RunControl> &) {
|
const auto onError = [this] {
|
||||||
const QString message(Tr::tr("Failed to build the project."));
|
const QString message(Tr::tr("Failed to build the project."));
|
||||||
m_infoBarWidget->setError(InfoBarWidget::Error, message, [this] { showOutputPane(); });
|
m_infoBarWidget->setError(InfoBarWidget::Error, message, [this] { showOutputPane(); });
|
||||||
m_runControl->postMessage(message, ErrorMessageFormat);
|
m_runControl->postMessage(message, ErrorMessageFormat);
|
||||||
@@ -803,7 +803,7 @@ Group ClangTool::runRecipe(const RunSettings &runSettings,
|
|||||||
return SetupResult::Continue;
|
return SetupResult::Continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto onTreeDone = [this, target, runSettings](const TaskTree &) {
|
const auto onTreeDone = [this, target, runSettings] {
|
||||||
if (m_filesFailed != 0) {
|
if (m_filesFailed != 0) {
|
||||||
m_runControl->postMessage(Tr::tr("Error: Failed to analyze %n files.", nullptr,
|
m_runControl->postMessage(Tr::tr("Error: Failed to analyze %n files.", nullptr,
|
||||||
m_filesFailed), ErrorMessageFormat);
|
m_filesFailed), ErrorMessageFormat);
|
||||||
|
@@ -365,7 +365,7 @@ GroupItem CMakeBuildStep::runRecipe()
|
|||||||
parseTarget = target();
|
parseTarget = target();
|
||||||
return SetupResult::Continue;
|
return SetupResult::Continue;
|
||||||
};
|
};
|
||||||
const auto onParserError = [this](const QPointer<Target> &) {
|
const auto onParserError = [this] {
|
||||||
emit addOutput(Tr::tr("Project did not parse successfully, cannot build."),
|
emit addOutput(Tr::tr("Project did not parse successfully, cannot build."),
|
||||||
OutputFormat::ErrorMessage);
|
OutputFormat::ErrorMessage);
|
||||||
};
|
};
|
||||||
|
@@ -441,7 +441,7 @@ void LocatorMatcher::start()
|
|||||||
emit serialOutputDataReady(serialOutputData);
|
emit serialOutputDataReady(serialOutputData);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const auto onCollectorDone = [collectorStorage](const ResultsCollector &, bool) {
|
const auto onCollectorDone = [collectorStorage] {
|
||||||
collectorStorage->m_collector = nullptr;
|
collectorStorage->m_collector = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -230,7 +230,7 @@ public:
|
|||||||
m_output->append(output);
|
m_output->append(output);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const auto onUnarchiverError = [this](const Unarchiver &) {
|
const auto onUnarchiverError = [this] {
|
||||||
m_label->setType(InfoLabel::Error);
|
m_label->setType(InfoLabel::Error);
|
||||||
m_label->setText(Tr::tr("There was an error while unarchiving."));
|
m_label->setText(Tr::tr("There was an error while unarchiving."));
|
||||||
};
|
};
|
||||||
|
@@ -250,13 +250,13 @@ void AttachCoreDialog::accepted()
|
|||||||
|
|
||||||
const Group root = {
|
const Group root = {
|
||||||
parallel,
|
parallel,
|
||||||
AsyncTask<ResultType>{[=](auto &task) {
|
AsyncTask<ResultType>{[this, copyFileAsync](auto &task) {
|
||||||
task.setConcurrentCallData(copyFileAsync, this->coreFile());
|
task.setConcurrentCallData(copyFileAsync, coreFile());
|
||||||
},
|
},
|
||||||
[=](const auto &task) { d->coreFileResult = task.result(); },
|
[=](const auto &task) { d->coreFileResult = task.result(); },
|
||||||
CallDoneIf::Success},
|
CallDoneIf::Success},
|
||||||
AsyncTask<ResultType>{[=](auto &task) {
|
AsyncTask<ResultType>{[this, copyFileAsync](auto &task) {
|
||||||
task.setConcurrentCallData(copyFileAsync, this->symbolFile());
|
task.setConcurrentCallData(copyFileAsync, symbolFile());
|
||||||
},
|
},
|
||||||
[=](const auto &task) { d->symbolFileResult = task.result(); },
|
[=](const auto &task) { d->symbolFileResult = task.result(); },
|
||||||
CallDoneIf::Success}
|
CallDoneIf::Success}
|
||||||
|
@@ -429,7 +429,7 @@ void BranchModel::refresh(const FilePath &workingDirectory, ShowError showError)
|
|||||||
};
|
};
|
||||||
|
|
||||||
const auto onForEachRefDone = [this, workingDirectory, showError](const Process &process,
|
const auto onForEachRefDone = [this, workingDirectory, showError](const Process &process,
|
||||||
bool success) {
|
bool success) {
|
||||||
if (!success) {
|
if (!success) {
|
||||||
if (showError == ShowError::No)
|
if (showError == ShowError::No)
|
||||||
return;
|
return;
|
||||||
|
@@ -164,7 +164,7 @@ GroupItem AbstractProcessStep::defaultProcessTask()
|
|||||||
const auto onSetup = [this](Process &process) {
|
const auto onSetup = [this](Process &process) {
|
||||||
return setupProcess(process) ? SetupResult::Continue : SetupResult::StopWithError;
|
return setupProcess(process) ? SetupResult::Continue : SetupResult::StopWithError;
|
||||||
};
|
};
|
||||||
const auto onDone = [this](const Process &process, bool) { handleProcessDone(process); };
|
const auto onDone = [this](const Process &process) { handleProcessDone(process); };
|
||||||
return ProcessTask(onSetup, onDone);
|
return ProcessTask(onSetup, onDone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -291,7 +291,7 @@ Tasking::GroupItem QMakeStep::runRecipe()
|
|||||||
return setupProcess(process) ? SetupResult::Continue : SetupResult::StopWithError;
|
return setupProcess(process) ? SetupResult::Continue : SetupResult::StopWithError;
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto onProcessDone = [this](const Process &process, bool) { handleProcessDone(process); };
|
const auto onProcessDone = [this](const Process &process) { handleProcessDone(process); };
|
||||||
|
|
||||||
const auto onDone = [this] {
|
const auto onDone = [this] {
|
||||||
emit buildConfiguration()->buildDirectoryInitialized();
|
emit buildConfiguration()->buildDirectoryInitialized();
|
||||||
|
@@ -140,7 +140,7 @@ GroupItem GenericDirectUploadStep::statTask(UploadStorage *storage,
|
|||||||
process.setCommand({deviceConfiguration()->filePath("stat"),
|
process.setCommand({deviceConfiguration()->filePath("stat"),
|
||||||
{"-t", Utils::ProcessArgs::quoteArgUnix(file.remoteFilePath())}});
|
{"-t", Utils::ProcessArgs::quoteArgUnix(file.remoteFilePath())}});
|
||||||
};
|
};
|
||||||
const auto onDone = [this, storage, file, statEndHandler](const Process &process, bool) {
|
const auto onDone = [this, storage, file, statEndHandler](const Process &process) {
|
||||||
Process *proc = const_cast<Process *>(&process);
|
Process *proc = const_cast<Process *>(&process);
|
||||||
const QDateTime timestamp = timestampFromStat(file, proc);
|
const QDateTime timestamp = timestampFromStat(file, proc);
|
||||||
statEndHandler(storage, file, timestamp);
|
statEndHandler(storage, file, timestamp);
|
||||||
|
@@ -78,8 +78,8 @@ void tst_Tasking::validConstructs()
|
|||||||
const Group task {
|
const Group task {
|
||||||
parallel,
|
parallel,
|
||||||
TestTask([](TaskObject &) {}, [](const TaskObject &, bool) {}),
|
TestTask([](TaskObject &) {}, [](const TaskObject &, bool) {}),
|
||||||
TestTask([](TaskObject &) {}, [](const TaskObject &, bool) {}),
|
TestTask([](TaskObject &) {}, [](const TaskObject &) {}),
|
||||||
TestTask([](TaskObject &) {}, [](const TaskObject &, bool) {})
|
TestTask([](TaskObject &) {}, [] {})
|
||||||
};
|
};
|
||||||
|
|
||||||
const Group group1 {
|
const Group group1 {
|
||||||
@@ -93,10 +93,10 @@ void tst_Tasking::validConstructs()
|
|||||||
TestTask([](TaskObject &) {}, [](const TaskObject &, bool) {}),
|
TestTask([](TaskObject &) {}, [](const TaskObject &, bool) {}),
|
||||||
Group {
|
Group {
|
||||||
parallel,
|
parallel,
|
||||||
TestTask([](TaskObject &) {}, [](const TaskObject &, bool) {}),
|
TestTask([](TaskObject &) {}, [](const TaskObject &) {}),
|
||||||
Group {
|
Group {
|
||||||
parallel,
|
parallel,
|
||||||
TestTask([](TaskObject &) {}, [](const TaskObject &, bool) {})
|
TestTask([](TaskObject &) {}, [] {})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Group {
|
Group {
|
||||||
|
Reference in New Issue
Block a user