Commit 7ad334d7 authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner.instances: fix qml2puppet check

We now check for Qt Quick 2 instead of Qt Quick 1.
This fixes issues with webview and confusion if there arent any imports.

Change-Id: I5979996dd618a88e96cb09ef24744f1f9bd51c47
Reviewed-on: http://codereview.qt.nokia.com/1506Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarMarco Bubke <marco.bubke@nokia.com>
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@nokia.com>
parent cd6e49d3
......@@ -77,11 +77,11 @@
namespace QmlDesigner {
static bool hasQtQuick1(NodeInstanceView *nodeInstanceView)
static bool hasQtQuick2(NodeInstanceView *nodeInstanceView)
{
if (nodeInstanceView && nodeInstanceView->model()) {
foreach (const Import &import ,nodeInstanceView->model()->imports()) {
if (import.url() == "QtQuick" && import.version().toDouble() < 2.0)
if (import.url() == "QtQuick" && import.version().toDouble() >= 2.0)
return true;
}
}
......@@ -436,10 +436,10 @@ void NodeInstanceServerProxy::readThirdDataStream()
QString NodeInstanceServerProxy::qmlPuppetApplicationName() const
{
QString appName;
if (hasQtQuick1(m_nodeInstanceView.data())) {
appName = QLatin1String("qmlpuppet");
} else {
if (hasQtQuick2(m_nodeInstanceView.data())) {
appName = QLatin1String("qml2puppet");
} else {
appName = QLatin1String("qmlpuppet");
}
#ifdef Q_OS_WIN
appName += QLatin1String(".exe");
......
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