forked from qt-creator/qt-creator
BuildSteps: emitting tasks from init() works fine
Change-Id: Ida5c7e9eea197d12ebe6e4bd86e90b2ef7e7a100 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -104,13 +104,13 @@ bool GenericMakeStep::init()
|
||||
if (!bc)
|
||||
bc = target()->activeBuildConfiguration();
|
||||
|
||||
m_tasks.clear();
|
||||
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit());
|
||||
if (!tc) {
|
||||
m_tasks.append(Task(Task::Error, tr("Qt Creator needs a compiler set up to build. Configure a compiler in the kit options."),
|
||||
emit addTask(Task(Task::Error, tr("Qt Creator needs a compiler set up to build. Configure a compiler in the kit options."),
|
||||
Utils::FileName(), -1,
|
||||
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
|
||||
return true; // otherwise the tasks will not get reported
|
||||
emit addOutput(tr("Configuration is faulty. Check the Issues view for details."), BuildStep::MessageOutput);
|
||||
return false;
|
||||
}
|
||||
|
||||
ProcessParameters *pp = processParameters();
|
||||
@@ -192,18 +192,6 @@ QString GenericMakeStep::makeCommand(const Utils::Environment &environment) cons
|
||||
|
||||
void GenericMakeStep::run(QFutureInterface<bool> &fi)
|
||||
{
|
||||
bool canContinue = true;
|
||||
foreach (const Task &t, m_tasks) {
|
||||
addTask(t);
|
||||
canContinue = false;
|
||||
}
|
||||
if (!canContinue) {
|
||||
emit addOutput(tr("Configuration is faulty. Check the Issues view for details."), BuildStep::MessageOutput);
|
||||
fi.reportResult(false);
|
||||
emit finished();
|
||||
return;
|
||||
}
|
||||
|
||||
AbstractProcessStep::run(fi);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user