Commit 8d6e3d22 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.DesignDocument: Fixing getActiveQtVersion()



The function currentProject() returns the current project based
on the current project node.
If the current document was newly created by a wizard, this did not work.
We use SessionManager::projectForFile() as a fallback.

For Qt Creator 3.2 we plan to unify this functionality with die Qml
code model.

Change-Id: I296224671a0b496fbf6fd0d8e62e74c28b4f9abb
Reviewed-by: default avatarMarco Bubke <marco.bubke@digia.com>
parent fed3e021
......@@ -43,6 +43,7 @@
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/project.h>
#include <projectexplorer/target.h>
#include <projectexplorer/session.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>
#include <qtsupport/qtversionmanager.h>
......@@ -651,6 +652,9 @@ static inline QtSupport::BaseQtVersion *getActiveQtVersion(DesignDocument *desig
ProjectExplorer::ProjectExplorerPlugin *projectExplorer = ProjectExplorer::ProjectExplorerPlugin::instance();
ProjectExplorer::Project *currentProject = projectExplorer->currentProject();
if (!currentProject)
currentProject = ProjectExplorer::SessionManager::projectForFile(designDocument->fileName());
if (!currentProject)
return 0;
......
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