summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2010-03-31 10:54:44 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2010-03-31 10:58:32 (GMT)
commit5323b5df1587d05de29857305ec0726e2f87610d (patch)
treec5c97075dabe5122539a818d7c40d70099203f4c /src/declarative/qml
parentf858af947c92ad77d0aa14bbf80171b9b822bd75 (diff)
downloadQt-5323b5df1587d05de29857305ec0726e2f87610d.zip
Qt-5323b5df1587d05de29857305ec0726e2f87610d.tar.gz
Qt-5323b5df1587d05de29857305ec0726e2f87610d.tar.bz2
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
Diffstat (limited to 'src/declarative/qml')
-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);
+ }
}