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 <qt_sanity_bot@ovi.com>
Reviewed-by: Marco Bubke <marco.bubke@nokia.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
This commit is contained in:
Thomas Hartmann
2011-07-14 12:35:00 +02:00
parent 9c5c805998
commit d53f595879

View File

@@ -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;