diff options
author | David Boddie <david.boddie@nokia.com> | 2010-12-06 18:00:42 (GMT) |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2010-12-06 18:00:42 (GMT) |
commit | 34bfad76d1afe4a0ee27496e740c8566387dc16c (patch) | |
tree | c4304699a1a2d4a729bddfb3102a5ba3ad9a2cd8 /src/declarative/qml/qdeclarativeimport.cpp | |
parent | 16c3df54960b776f35f59288b888e829e7e81002 (diff) | |
parent | 608b66b5af75ae6982be428439eea735c00cc455 (diff) | |
download | Qt-34bfad76d1afe4a0ee27496e740c8566387dc16c.zip Qt-34bfad76d1afe4a0ee27496e740c8566387dc16c.tar.gz Qt-34bfad76d1afe4a0ee27496e740c8566387dc16c.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-doc-team into 4.7
Diffstat (limited to 'src/declarative/qml/qdeclarativeimport.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativeimport.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativeimport.cpp b/src/declarative/qml/qdeclarativeimport.cpp index 6f5216a..acc13de 100644 --- a/src/declarative/qml/qdeclarativeimport.cpp +++ b/src/declarative/qml/qdeclarativeimport.cpp @@ -51,6 +51,10 @@ #include <private/qdeclarativetypenamecache_p.h> #include <private/qdeclarativeengine_p.h> +#ifdef Q_OS_SYMBIAN +#include "private/qcore_symbian_p.h" +#endif + QT_BEGIN_NAMESPACE DEFINE_BOOL_CONFIG_OPTION(qmlImportTrace, QML_IMPORT_TRACE) @@ -658,8 +662,32 @@ QDeclarativeImportDatabase::QDeclarativeImportDatabase(QDeclarativeEngine *e) // Search order is applicationDirPath(), $QML_IMPORT_PATH, QLibraryInfo::ImportsPath - addImportPath(QLibraryInfo::location(QLibraryInfo::ImportsPath)); + QString installImportsPath = QLibraryInfo::location(QLibraryInfo::ImportsPath); +#if defined(Q_OS_SYMBIAN) + // Append imports path for all available drives in Symbian + if (installImportsPath.at(1) != QChar(QLatin1Char(':'))) { + QString tempPath = installImportsPath; + if (tempPath.at(tempPath.length() - 1) != QDir::separator()) { + tempPath += QDir::separator(); + } + RFs& fs = qt_s60GetRFs(); + TPtrC tempPathPtr(reinterpret_cast<const TText*> (tempPath.constData())); + TFindFile finder(fs); + TInt err = finder.FindByDir(tempPathPtr, tempPathPtr); + while (err == KErrNone) { + QString foundDir(reinterpret_cast<const QChar *>(finder.File().Ptr()), + finder.File().Length()); + foundDir = QDir(foundDir).canonicalPath(); + addImportPath(foundDir); + err = finder.Find(); + } + } else { + addImportPath(installImportsPath); + } +#else + addImportPath(installImportsPath); +#endif // env import paths QByteArray envImportPath = qgetenv("QML_IMPORT_PATH"); if (!envImportPath.isEmpty()) { |