Commit 1c401481 authored by Christian Kamm's avatar Christian Kamm Committed by Kai Koehne

QmlProject: Don't crash if there's no active target.

Change-Id: I0fd95f0d388f4ba06936ec9164a91a3c53a0f005
Reviewed-on: http://codereview.qt.nokia.com/104Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarKai Koehne <kai.koehne@nokia.com>
parent b8734dd7
......@@ -144,9 +144,11 @@ void QmlProject::refresh(RefreshOptions options)
pinfo.sourceFiles = files();
pinfo.importPaths = importPaths();
QtSupport::BaseQtVersion *version = 0;
if (activeTarget()) {
if (QmlProjectRunConfiguration *rc = qobject_cast<QmlProjectRunConfiguration *>(activeTarget()->activeRunConfiguration()))
version = rc->qtVersion();
QtSupport::QmlDumpTool::pathAndEnvironment(this, version, false, &pinfo.qmlDumpPath, &pinfo.qmlDumpEnvironment);
}
m_modelManager->updateProjectInfo(pinfo);
}
......@@ -289,9 +291,11 @@ bool QmlProject::fromMap(const QVariantMap &map)
refresh(Everything);
// FIXME workaround to guarantee that run/debug actions are enabled if a valid file exists
if (activeTarget()) {
QmlProjectRunConfiguration *runConfig = qobject_cast<QmlProjectRunConfiguration*>(activeTarget()->activeRunConfiguration());
if (runConfig)
runConfig->changeCurrentFile(0);
}
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment