From 22736921deaed191012ac306f46fb62b7ed0e15e Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 13 Jun 2019 14:54:35 +0200 Subject: [PATCH] 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 --- src/plugins/qmakeprojectmanager/qmakeproject.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index 3b5e4531b6a..dee31c56af7 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -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 {