diff options
author | mread <qt-info@nokia.com> | 2011-09-21 10:35:14 (GMT) |
---|---|---|
committer | mread <qt-info@nokia.com> | 2011-09-21 10:49:02 (GMT) |
commit | 849694e4cb9d010517b54b2b30035485487b0e12 (patch) | |
tree | bf3558f740675db0fea8ab6b072de9186e6faddb /src/declarative | |
parent | d04f37fa73d2fbb78dd85a02e9d3180ed4ddbdab (diff) | |
download | Qt-849694e4cb9d010517b54b2b30035485487b0e12.zip Qt-849694e4cb9d010517b54b2b30035485487b0e12.tar.gz Qt-849694e4cb9d010517b54b2b30035485487b0e12.tar.bz2 |
QML import path puts Qt dirs in correct Symbian order
The QML import path contains an entry for the standard
import location on each drive on Symbian. These were
being ordered so that Z:, the ROM drive, was listed
first. In fact the drive order was the reverse of the
normal Symbian drive search order. This had the effect
that upgraded versions of QML imports installed on
the device were generally ignored for older ROM based
versions.
The import path has now been changed to match the normal
Symbian drive search order. This will make it more likely
for upgraded QML imports to be picked up and used.
Task-number: QTBUG-21409
Reviewed-by: Shane Kearns
Reviewed-by: Martin Jones
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/qdeclarativeimport.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativeimport.cpp b/src/declarative/qml/qdeclarativeimport.cpp index 6e0b348..c25207a 100644 --- a/src/declarative/qml/qdeclarativeimport.cpp +++ b/src/declarative/qml/qdeclarativeimport.cpp @@ -46,6 +46,7 @@ #include <QtCore/qfileinfo.h> #include <QtCore/qpluginloader.h> #include <QtCore/qlibraryinfo.h> +#include <QtCore/qalgorithms.h> #include <QtDeclarative/qdeclarativeextensioninterface.h> #include <private/qdeclarativeglobal_p.h> #include <private/qdeclarativetypenamecache_p.h> @@ -733,8 +734,12 @@ QDeclarativeImportDatabase::QDeclarativeImportDatabase(QDeclarativeEngine *e) } RFs& fs = qt_s60GetRFs(); TPtrC tempPathPtr(reinterpret_cast<const TText*> (tempPath.constData())); + // Symbian searches should start from Y:. Fix start drive otherwise TFindFile starts from the session drive + _LIT(KStartDir, "Y:"); + TFileName dirPath(KStartDir); + dirPath.Append(tempPathPtr); TFindFile finder(fs); - TInt err = finder.FindByDir(tempPathPtr, tempPathPtr); + TInt err = finder.FindByDir(tempPathPtr, dirPath); while (err == KErrNone) { QString foundDir(reinterpret_cast<const QChar *>(finder.File().Ptr()), finder.File().Length()); @@ -742,6 +747,9 @@ QDeclarativeImportDatabase::QDeclarativeImportDatabase(QDeclarativeEngine *e) addImportPath(foundDir); err = finder.Find(); } + // TFindFile found the directories in the order we want, but addImportPath reverses it. + // Reverse the order again to get it right. + QAlgorithmsPrivate::qReverse(fileImportPath.begin(), fileImportPath.end()); } else { addImportPath(installImportsPath); } |