forked from qt-creator/qt-creator
TaskTree: Get rid of onGroupError element
Make it possible to setup onGroupDone element with additional OnDone argument. The onGroupDone handler may accept extra DoneResult argument. The onGroupDone handler may also tweak the success bit of a group. All above features conform to the behavior of the task done handler. Task-number: QTCREATORBUG-29834 Change-Id: I125bdfe155e585678fb33410632246401cbc9390 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -132,24 +132,21 @@ DiffFilesController::DiffFilesController(IDocument *document)
|
||||
}
|
||||
taskTree.setRecipe(tasks);
|
||||
};
|
||||
const auto onTreeDone = [this, storage] {
|
||||
const QList<std::optional<FileData>> &results = *storage;
|
||||
const auto onTreeDone = [this, storage](DoneWith result) {
|
||||
QList<FileData> finalList;
|
||||
for (const std::optional<FileData> &result : results) {
|
||||
if (result.has_value())
|
||||
finalList.append(*result);
|
||||
if (result == DoneWith::Success) {
|
||||
const QList<std::optional<FileData>> &results = *storage;
|
||||
for (const std::optional<FileData> &result : results) {
|
||||
if (result.has_value())
|
||||
finalList.append(*result);
|
||||
}
|
||||
}
|
||||
setDiffFiles(finalList);
|
||||
};
|
||||
const auto onTreeError = [this, storage] {
|
||||
setDiffFiles({});
|
||||
};
|
||||
|
||||
const Group root = {
|
||||
Storage(storage),
|
||||
TaskTreeTask(onTreeSetup),
|
||||
onGroupDone(onTreeDone),
|
||||
onGroupError(onTreeError)
|
||||
TaskTreeTask(onTreeSetup, onTreeDone)
|
||||
};
|
||||
setReloadRecipe(root);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user