aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2019-06-13 14:54:35 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2019-06-17 10:15:28 +0000
commit22736921deaed191012ac306f46fb62b7ed0e15e (patch)
tree4bb4532675c4b2de1aab27fbb45968d480f490b4
parentc23e3196285ca5024ea6b86d974b8f358ec1b551 (diff)
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>
-rw-r--r--src/plugins/qmakeprojectmanager/qmakeproject.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp
index 3b5e4531b6..dee31c56af 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 {