summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativeimport.cpp
diff options
context:
space:
mode:
authorJoona Petrell <joona.t.petrell@nokia.com>2010-12-02 15:16:58 +1000
committerJoona Petrell <joona.t.petrell@nokia.com>2010-12-02 18:42:08 +1000
commitd4b73604d545da4ab802f22a55fbf420f4bf5baa (patch)
tree4c8abe79813fed56589d662682e599c957a96b31 /src/declarative/qml/qdeclarativeimport.cpp
parentafbf017b8929d1215851dc43823de61fb1ffa400 (diff)
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/qdeclarativeimport.cpp')
-rw-r--r--src/declarative/qml/qdeclarativeimport.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativeimport.cpp b/src/declarative/qml/qdeclarativeimport.cpp
index 6f5216ab33..acc13de9d4 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()) {