From d53f5958794b9808b66a0c65b8dd3f7c17a93a8a Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Thu, 14 Jul 2011 12:35:00 +0200 Subject: [PATCH] QmlDesigner.instances: clean import paths from .1.0 Plugin directories might contain the version number, but they do not have to. We try to map .1.0 to "" for components delivered with Creator. Change-Id: Ie785cf29d4dd64a504501d2be501fd6aa733973b Reviewed-on: http://codereview.qt.nokia.com/1659 Reviewed-by: Qt Sanity Bot Reviewed-by: Marco Bubke Reviewed-by: Thomas Hartmann --- .../qml/qmlpuppet/instances/objectnodeinstance.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/share/qtcreator/qml/qmlpuppet/instances/objectnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/instances/objectnodeinstance.cpp index 2d6fda7eac0..fe10d9555fb 100644 --- a/share/qtcreator/qml/qmlpuppet/instances/objectnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/instances/objectnodeinstance.cpp @@ -784,6 +784,14 @@ static inline QString fixComponentPathForIncompatibleQt(const QString &component fixedComponentPath.replace(QLatin1Char('\\'), QLatin1Char('/')); if (QFileInfo(fixedComponentPath).exists()) return fixedComponentPath; + QString fixedPath = QFileInfo(fixedComponentPath).path(); + if (fixedPath.endsWith(QLatin1String(".1.0"))) { + //plugin directories might contain the version number + fixedPath.chop(4); + fixedPath += QLatin1Char('/') + QFileInfo(componentPath).fileName(); + if (QFileInfo(fixedPath).exists()) + return fixedPath; + } } return result;