forked from qt-creator/qt-creator
TaskTree: Introduce CallDoneIf enum
Get rid of CustomTask c'tor taking 3 handlers. If the done handler needs to be called only on success or an error, add explicit 3rd arg of CallDoneIf type. Task-number: QTCREATORBUG-29834 Change-Id: I10e55415587e6cac46620dd5177ad8269584583c Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -118,7 +118,7 @@ DiffFilesController::DiffFilesController(IDocument *document)
|
||||
|
||||
QList<GroupItem> tasks { parallel, finishAllAndDone };
|
||||
for (int i = 0; i < inputList.size(); ++i) {
|
||||
const auto setupDiff = [this, reloadInput = inputList.at(i)](Async<FileData> &async) {
|
||||
const auto onDiffSetup = [this, reloadInput = inputList.at(i)](Async<FileData> &async) {
|
||||
async.setConcurrentCallData(
|
||||
DiffFile(ignoreWhitespace(), contextLineCount()), reloadInput);
|
||||
async.setFutureSynchronizer(ExtensionSystem::PluginManager::futureSynchronizer());
|
||||
@@ -128,7 +128,7 @@ DiffFilesController::DiffFilesController(IDocument *document)
|
||||
if (async.isResultAvailable())
|
||||
(*outputList)[i] = async.result();
|
||||
};
|
||||
tasks.append(AsyncTask<FileData>(setupDiff, onDiffDone));
|
||||
tasks.append(AsyncTask<FileData>(onDiffSetup, onDiffDone, CallDoneIf::Success));
|
||||
}
|
||||
taskTree.setRecipe(tasks);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user