ProjectExplorer: Improve error message in case of missing project file

This was kind of done for AndroidRunConfigurations, but seems uniformly
applicable as all projects have something like a "project file"
currently.

Change-Id: I48e1887ea900181b5bf42f75fb9412379a8320dc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-02-22 12:32:38 +01:00
parent 8536504caa
commit c255562fec

View File

@@ -218,8 +218,13 @@ QString RunConfiguration::disabledReason() const
return tr("The project no longer builds the target associated with this run configuration.");
if (target()->project()->isParsing())
return tr("The Project is currently being parsed.");
if (!target()->project()->hasParsingData())
return tr("The project could not be fully parsed.");
if (!target()->project()->hasParsingData()) {
QString msg = tr("The project could not be fully parsed.");
const FileName projectFilePath = buildTargetInfo().projectFilePath;
if (!projectFilePath.exists())
msg += '\n' + tr("The project file \"%1\" does not exist.").arg(projectFilePath.toString());
return msg;
}
return QString();
}