From 5323b5df1587d05de29857305ec0726e2f87610d Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 31 Mar 2010 12:54:44 +0200 Subject: Fix bug when adding import paths manually Paths were being added relatively even though they should be converted to a canoncial form. Patch originally by tmikola Reviewed-by: mae --- src/declarative/qml/qdeclarativeengine.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index bb742ee..2cae632 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -1788,7 +1788,13 @@ void QDeclarativeEngine::addImportPath(const QString& path) if (qmlImportTrace()) qDebug() << "QDeclarativeEngine::addImportPath" << path; Q_D(QDeclarativeEngine); - d->fileImportPath.prepend(path); + QUrl url = QUrl(path); + if (url.isRelative() || url.scheme() == QString::fromLocal8Bit("file")) { + QDir dir = QDir(path); + d->fileImportPath.prepend(dir.canonicalPath()); + } else { + d->fileImportPath.prepend(path); + } } -- cgit v0.12