forked from qt-creator/qt-creator
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: Marco Bubke <marco.bubke@digia.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user