forked from qt-creator/qt-creator
TaskTree: Rename setupRoot into setRecipe
The passed Group root element is a recipe with a full description on how to execute the tasks and how to handle finished tasks. We have already virtual methods / setters called like: deployRecipe, refreshRecipe, reloadRecipe. So, the common "recipe" is kind of consistent. Fix typos in warnings. Addresses the 11th point in the task below. Task-number: QTCREATORBUG-28741 Change-Id: I1c80f4838b6a3e5ed113eaf8e42b59746d098efe Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -1750,9 +1750,9 @@ TaskTree::TaskTree()
|
||||
{
|
||||
}
|
||||
|
||||
TaskTree::TaskTree(const Group &root) : TaskTree()
|
||||
TaskTree::TaskTree(const Group &recipe) : TaskTree()
|
||||
{
|
||||
setupRoot(root);
|
||||
setRecipe(recipe);
|
||||
}
|
||||
|
||||
TaskTree::~TaskTree()
|
||||
@@ -1763,27 +1763,27 @@ TaskTree::~TaskTree()
|
||||
delete d;
|
||||
}
|
||||
|
||||
void TaskTree::setupRoot(const Group &root)
|
||||
void TaskTree::setRecipe(const Group &recipe)
|
||||
{
|
||||
QTC_ASSERT(!isRunning(), qWarning("The TaskTree is already running, ignoring..."); return);
|
||||
QTC_ASSERT(!d->m_guard.isLocked(), qWarning("The setupRoot() is called from one of the"
|
||||
"TaskTree handlers, ingoring..."); return);
|
||||
QTC_ASSERT(!d->m_guard.isLocked(), qWarning("The setRecipe() is called from one of the"
|
||||
"TaskTree handlers, ignoring..."); return);
|
||||
d->m_storages.clear();
|
||||
d->m_root.reset(new TaskNode(d, root, nullptr));
|
||||
d->m_root.reset(new TaskNode(d, recipe, nullptr));
|
||||
}
|
||||
|
||||
void TaskTree::start()
|
||||
{
|
||||
QTC_ASSERT(!isRunning(), qWarning("The TaskTree is already running, ignoring..."); return);
|
||||
QTC_ASSERT(!d->m_guard.isLocked(), qWarning("The start() is called from one of the"
|
||||
"TaskTree handlers, ingoring..."); return);
|
||||
"TaskTree handlers, ignoring..."); return);
|
||||
d->start();
|
||||
}
|
||||
|
||||
void TaskTree::stop()
|
||||
{
|
||||
QTC_ASSERT(!d->m_guard.isLocked(), qWarning("The stop() is called from one of the"
|
||||
"TaskTree handlers, ingoring..."); return);
|
||||
"TaskTree handlers, ignoring..."); return);
|
||||
d->stop();
|
||||
}
|
||||
|
||||
|
@@ -378,10 +378,10 @@ class TASKING_EXPORT TaskTree final : public QObject
|
||||
|
||||
public:
|
||||
TaskTree();
|
||||
TaskTree(const Group &root);
|
||||
TaskTree(const Group &recipe);
|
||||
~TaskTree();
|
||||
|
||||
void setupRoot(const Group &root);
|
||||
void setRecipe(const Group &recipe);
|
||||
|
||||
void start();
|
||||
void stop();
|
||||
|
@@ -490,7 +490,7 @@ void LocatorMatcher::start()
|
||||
}
|
||||
};
|
||||
|
||||
d->m_taskTree->setupRoot(root);
|
||||
d->m_taskTree->setRecipe(root);
|
||||
|
||||
const auto onFinish = [this](bool success) {
|
||||
return [this, success] {
|
||||
|
@@ -257,7 +257,7 @@ void AttachCoreDialog::accepted()
|
||||
[=](const auto &task) { d->symbolFileResult = task.result(); }},
|
||||
};
|
||||
|
||||
d->taskTree.setupRoot(root);
|
||||
d->taskTree.setRecipe(root);
|
||||
d->taskTree.start();
|
||||
|
||||
d->progressLabel->setText(Tr::tr("Copying files to device..."));
|
||||
|
@@ -133,7 +133,7 @@ DiffFilesController::DiffFilesController(IDocument *document)
|
||||
tasks.append(AsyncTask<FileData>(std::bind(setupDiff, _1, inputList.at(i)),
|
||||
std::bind(onDiffDone, _1, i)));
|
||||
}
|
||||
taskTree.setupRoot(tasks);
|
||||
taskTree.setRecipe(tasks);
|
||||
};
|
||||
const auto onTreeDone = [this, storage] {
|
||||
const QList<std::optional<FileData>> &results = *storage;
|
||||
|
@@ -446,7 +446,7 @@ ShowController::ShowController(IDocument *document, const QString &id)
|
||||
tasks.append(ProcessTask(std::bind(setupFollow, _1, parents.at(i)),
|
||||
std::bind(onFollowDone, _1, i)));
|
||||
}
|
||||
taskTree.setupRoot(tasks);
|
||||
taskTree.setRecipe(tasks);
|
||||
};
|
||||
|
||||
const auto setupDiff = [this, id](Process &process) {
|
||||
|
@@ -228,7 +228,7 @@ GroupItem QnxDeployQtLibrariesDialogPrivate::chmodTree()
|
||||
QTC_ASSERT(file.isValid(), continue);
|
||||
chmodList.append(chmodTask(file));
|
||||
}
|
||||
tree.setupRoot(chmodList);
|
||||
tree.setRecipe(chmodList);
|
||||
};
|
||||
return TaskTreeTask{setupChmodHandler};
|
||||
}
|
||||
|
@@ -184,7 +184,7 @@ GroupItem GenericDirectUploadStep::statTree(const TreeStorage<UploadStorage> &st
|
||||
QTC_ASSERT(file.isValid(), continue);
|
||||
statList.append(statTask(storagePtr, file, statEndHandler));
|
||||
}
|
||||
tree.setupRoot({statList});
|
||||
tree.setRecipe({statList});
|
||||
};
|
||||
return TaskTreeTask(setupHandler);
|
||||
}
|
||||
@@ -261,7 +261,7 @@ GroupItem GenericDirectUploadStep::chmodTree(const TreeStorage<UploadStorage> &s
|
||||
QTC_ASSERT(file.isValid(), continue);
|
||||
chmodList.append(chmodTask(file));
|
||||
}
|
||||
tree.setupRoot({chmodList});
|
||||
tree.setRecipe({chmodList});
|
||||
};
|
||||
return TaskTreeTask(setupChmodHandler);
|
||||
}
|
||||
|
@@ -509,7 +509,7 @@ void tst_Tasking::testTree_data()
|
||||
createSuccessTask(3),
|
||||
createSuccessTask(4)
|
||||
};
|
||||
taskTree.setupRoot(nestedRoot);
|
||||
taskTree.setRecipe(nestedRoot);
|
||||
CustomStorage *activeStorage = storage.activeStorage();
|
||||
auto collectSubLog = [activeStorage](CustomStorage *subTreeStorage){
|
||||
activeStorage->m_log += subTreeStorage->m_log;
|
||||
|
Reference in New Issue
Block a user