QmakeProjectManager: Abort project parsing early if no Qt is present

Parsing would not succeed anyway, and the pro parser can run into
assertions, e.g. in IoUtils::fileType().

Change-Id: I7fff466d858a2d3c9fd975246a20c92134963705
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2019-06-13 14:54:35 +02:00
parent c23e319628
commit 22736921de

View File

@@ -523,6 +523,21 @@ void QmakeProject::asyncUpdate()
m_asyncUpdateFutureInterface->reportStarted();
const Kit * const kit = activeTarget() ? activeTarget()->kit() : nullptr;
QtSupport::BaseQtVersion * const qtVersion = QtSupport::QtKitAspect::qtVersion(kit);
if (!qtVersion || !qtVersion->isValid()) {
const QString errorMessage = kit
? tr("Cannot parse project \"%1\": The currently selected kit \"%2\" does not "
"have a valid Qt.").arg(displayName(), kit->displayName())
: tr("Cannot parse project \"%1\": No kit selected.").arg(displayName());
proFileParseError(errorMessage);
m_asyncUpdateFutureInterface->reportCanceled();
m_asyncUpdateFutureInterface->reportFinished();
delete m_asyncUpdateFutureInterface;
m_asyncUpdateFutureInterface = nullptr;
return;
}
if (m_asyncUpdateState == AsyncFullUpdatePending) {
rootProFile()->asyncUpdate();
} else {