ProjectExplorer: Report project-specific kit errors/warnings

Report project-specific warnings about the kit used in Project Mode.
E.g. a python project should not complain about missing toolchains,
while a qmake project should.

Change-Id: I5ce6742683cdeffc7ff3f1a3e8f0b89aee9aa0b4
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Tobias Hunger
2018-04-18 13:39:05 +02:00
parent da18fc1f50
commit 460fdc02e0
17 changed files with 119 additions and 105 deletions

View File

@@ -154,20 +154,16 @@ void NimProject::updateProject()
emitParsingFinished(true);
}
bool NimProject::supportsKit(const Kit *k, QString *errorMessage) const
QList<Task> NimProject::projectIssues(const Kit *k) const
{
QList<Task> result = Project::projectIssues(k);
auto tc = dynamic_cast<NimToolChain*>(ToolChainKitInformation::toolChain(k, Constants::C_NIMLANGUAGE_ID));
if (!tc) {
if (errorMessage)
*errorMessage = tr("No Nim compiler set.");
return false;
}
if (!tc->compilerCommand().exists()) {
if (errorMessage)
*errorMessage = tr("Nim compiler does not exist.");
return false;
}
return true;
if (!tc)
result.append(createProjectTask(Task::TaskType::Error, tr("No Nim compiler set.")));
if (!tc->compilerCommand().exists())
result.append(createProjectTask(Task::TaskType::Error, tr("Nim compiler does not exist.")));
return result;
}
FileNameList NimProject::nimFiles() const