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:
Jarek Kobus
2023-11-02 23:19:49 +01:00
parent 34cef824b5
commit b5f77f6d55
12 changed files with 23 additions and 23 deletions

View File

@@ -266,7 +266,7 @@ private:
process.setWriteData(m_writeData);
connect(&process, &Process::started, this, [this] { emit started(); });
};
const auto onDone = [this](const Process &, bool) {
const auto onDone = [this] {
delete m_writeBuffer;
m_writeBuffer = nullptr;
};
@@ -278,7 +278,7 @@ private:
async.setConcurrentCallData(localWrite, m_filePath, m_writeData, m_writeBuffer);
emit started();
};
const auto onDone = [this](const Async<void> &, bool) {
const auto onDone = [this] {
delete m_writeBuffer;
m_writeBuffer = nullptr;
};
@@ -327,17 +327,17 @@ static Group interDeviceTransferTask(const FilePath &source, const FilePath &des
SingleBarrier writerReadyBarrier;
TreeStorage<TransferStorage> storage;
const auto onReaderSetup = [=](FileStreamReader &reader) {
const auto onReaderSetup = [storage, source](FileStreamReader &reader) {
reader.setFilePath(source);
QTC_CHECK(storage->writer != nullptr);
QObject::connect(&reader, &FileStreamReader::readyRead,
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().
storage->writer->closeWriteChannel();
};
const auto onWriterSetup = [=](FileStreamWriter &writer) {
const auto onWriterSetup = [writerReadyBarrier, storage, destination](FileStreamWriter &writer) {
writer.setFilePath(destination);
QObject::connect(&writer, &FileStreamWriter::started,
writerReadyBarrier->barrier(), &Barrier::advance);

View File

@@ -410,7 +410,7 @@ void TestRunner::runTestsHelper()
qCInfo(runnerLog) << "Working directory:" << process.workingDirectory();
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();
QTC_ASSERT(testStorage, return);
if (process.result() == ProcessResult::StartFailed) {

View File

@@ -686,7 +686,7 @@ Group ClangTool::runRecipe(const RunSettings &runSettings,
const auto onSetup = [runControl](QPointer<RunControl> &buildRunControl) {
buildRunControl = runControl;
};
const auto onError = [this](const QPointer<RunControl> &) {
const auto onError = [this] {
const QString message(Tr::tr("Failed to build the project."));
m_infoBarWidget->setError(InfoBarWidget::Error, message, [this] { showOutputPane(); });
m_runControl->postMessage(message, ErrorMessageFormat);
@@ -803,7 +803,7 @@ Group ClangTool::runRecipe(const RunSettings &runSettings,
return SetupResult::Continue;
};
const auto onTreeDone = [this, target, runSettings](const TaskTree &) {
const auto onTreeDone = [this, target, runSettings] {
if (m_filesFailed != 0) {
m_runControl->postMessage(Tr::tr("Error: Failed to analyze %n files.", nullptr,
m_filesFailed), ErrorMessageFormat);

View File

@@ -365,7 +365,7 @@ GroupItem CMakeBuildStep::runRecipe()
parseTarget = target();
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."),
OutputFormat::ErrorMessage);
};

View File

@@ -441,7 +441,7 @@ void LocatorMatcher::start()
emit serialOutputDataReady(serialOutputData);
});
};
const auto onCollectorDone = [collectorStorage](const ResultsCollector &, bool) {
const auto onCollectorDone = [collectorStorage] {
collectorStorage->m_collector = nullptr;
};

View File

@@ -230,7 +230,7 @@ public:
m_output->append(output);
});
};
const auto onUnarchiverError = [this](const Unarchiver &) {
const auto onUnarchiverError = [this] {
m_label->setType(InfoLabel::Error);
m_label->setText(Tr::tr("There was an error while unarchiving."));
};

View File

@@ -250,13 +250,13 @@ void AttachCoreDialog::accepted()
const Group root = {
parallel,
AsyncTask<ResultType>{[=](auto &task) {
task.setConcurrentCallData(copyFileAsync, this->coreFile());
AsyncTask<ResultType>{[this, copyFileAsync](auto &task) {
task.setConcurrentCallData(copyFileAsync, coreFile());
},
[=](const auto &task) { d->coreFileResult = task.result(); },
CallDoneIf::Success},
AsyncTask<ResultType>{[=](auto &task) {
task.setConcurrentCallData(copyFileAsync, this->symbolFile());
AsyncTask<ResultType>{[this, copyFileAsync](auto &task) {
task.setConcurrentCallData(copyFileAsync, symbolFile());
},
[=](const auto &task) { d->symbolFileResult = task.result(); },
CallDoneIf::Success}

View File

@@ -164,7 +164,7 @@ GroupItem AbstractProcessStep::defaultProcessTask()
const auto onSetup = [this](Process &process) {
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);
}

View File

@@ -291,7 +291,7 @@ Tasking::GroupItem QMakeStep::runRecipe()
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] {
emit buildConfiguration()->buildDirectoryInitialized();

View File

@@ -140,7 +140,7 @@ GroupItem GenericDirectUploadStep::statTask(UploadStorage *storage,
process.setCommand({deviceConfiguration()->filePath("stat"),
{"-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);
const QDateTime timestamp = timestampFromStat(file, proc);
statEndHandler(storage, file, timestamp);

View File

@@ -78,8 +78,8 @@ void tst_Tasking::validConstructs()
const Group task {
parallel,
TestTask([](TaskObject &) {}, [](const TaskObject &, bool) {}),
TestTask([](TaskObject &) {}, [](const TaskObject &, bool) {}),
TestTask([](TaskObject &) {}, [](const TaskObject &, bool) {})
TestTask([](TaskObject &) {}, [](const TaskObject &) {}),
TestTask([](TaskObject &) {}, [] {})
};
const Group group1 {
@@ -93,10 +93,10 @@ void tst_Tasking::validConstructs()
TestTask([](TaskObject &) {}, [](const TaskObject &, bool) {}),
Group {
parallel,
TestTask([](TaskObject &) {}, [](const TaskObject &, bool) {}),
TestTask([](TaskObject &) {}, [](const TaskObject &) {}),
Group {
parallel,
TestTask([](TaskObject &) {}, [](const TaskObject &, bool) {})
TestTask([](TaskObject &) {}, [] {})
}
},
Group {