diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2010-03-31 10:54:44 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2010-03-31 10:58:32 (GMT) |
commit | 5323b5df1587d05de29857305ec0726e2f87610d (patch) | |
tree | c5c97075dabe5122539a818d7c40d70099203f4c /src | |
parent | f858af947c92ad77d0aa14bbf80171b9b822bd75 (diff) | |
download | Qt-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')
-rw-r--r-- | src/declarative/qml/qdeclarativeengine.cpp | 8 |
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); + } } |