Android: Don't skip first file in assets entry list
We're using AAssetDir_getNextFileName() to verify that the directory exists and has content, and this moves the current file pointer to the second file in the dir, so we need to reset the pointer before iterating to populate the entry list. [ChangeLog][Android] Fixed QDir::entryList() for assets scheme to no longer skip the first file in the directory. Task-number: QTBUG-36528 Change-Id: I9938c669658330b0e11d6fbe3df8c6566fd79f5f Reviewed-by: BogDan Vatra <bogdan@kde.org>
This commit is contained in:
parent
f2b6307af2
commit
55db6736ac
@ -293,6 +293,7 @@ QAbstractFileEngine * AndroidAssetsFileEngineHandler::create(const QString &file
|
|||||||
AAssetDir *assetDir = AAssetManager_openDir(m_assetManager, path.constData() + prefixSize);
|
AAssetDir *assetDir = AAssetManager_openDir(m_assetManager, path.constData() + prefixSize);
|
||||||
if (assetDir) {
|
if (assetDir) {
|
||||||
if (AAssetDir_getNextFileName(assetDir)) {
|
if (AAssetDir_getNextFileName(assetDir)) {
|
||||||
|
AAssetDir_rewind(assetDir);
|
||||||
aad = new QSharedPointer<AndroidAssetDir>(new AndroidAssetDir(assetDir));
|
aad = new QSharedPointer<AndroidAssetDir>(new AndroidAssetDir(assetDir));
|
||||||
m_assetsCacheMutext.lock();
|
m_assetsCacheMutext.lock();
|
||||||
m_assetsCache.insert(path, aad);
|
m_assetsCache.insert(path, aad);
|
||||||
|
Loading…
Reference in New Issue
Block a user