diff options
author | Joona Petrell <joona.t.petrell@nokia.com> | 2010-12-02 05:16:58 (GMT) |
---|---|---|
committer | Joona Petrell <joona.t.petrell@nokia.com> | 2010-12-02 08:42:08 (GMT) |
commit | d4b73604d545da4ab802f22a55fbf420f4bf5baa (patch) | |
tree | 4c8abe79813fed56589d662682e599c957a96b31 /src/declarative/qml | |
parent | afbf017b8929d1215851dc43823de61fb1ffa400 (diff) | |
download | Qt-d4b73604d545da4ab802f22a55fbf420f4bf5baa.zip Qt-d4b73604d545da4ab802f22a55fbf420f4bf5baa.tar.gz Qt-d4b73604d545da4ab802f22a55fbf420f4bf5baa.tar.bz2 |
Append qml import path individually for each available drive on Symbian
Task-number: QTBUG-15405
Reviewed-by: Jason Barron
Diffstat (limited to 'src/declarative/qml')
-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()) { |