summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp8
1 files changed, 7 insertions, 1 deletions
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);
+ }
}