From aa7b2436b5a357ea7d76eebaecab0c05719b5c91 Mon Sep 17 00:00:00 2001 From: Bartlomiej Moskal Date: Mon, 21 Nov 2022 17:28:52 +0100 Subject: Android: fix Android assets handler not listing dirs with only sub dirs It looks like AAssetDir_getNextFileName is not enough. Directories that contain only other directories (no files) were not listed. On the other hand, AAssetManager_openDir() will always return a pointer to initialized object (even if the specified directory does not exists), so we can't just leave only it here. Using FolderIterator as a last resort. This approach should not be too time consuming. As part of this fix, add some unit tests to cover/ensure assets listing/iterating works as expected. Fixes: QTBUG-107627 Change-Id: Id375fe8f99f4ca3f8cad4756f783ffafe5c074df Reviewed-by: Assam Boudjelthia (cherry picked from commit 4ceee3911a2ef567f614fc296475bc2b2a0e3add) --- .../top_level_dir/sub_dir/sub_dir2/sub_dir3/file_in_sub_dir_3.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/auto/other/android/testdata/top_level_dir/sub_dir/sub_dir2/sub_dir3/file_in_sub_dir_3.txt (limited to 'tests/auto/other/android/testdata/top_level_dir/sub_dir/sub_dir2/sub_dir3/file_in_sub_dir_3.txt') diff --git a/tests/auto/other/android/testdata/top_level_dir/sub_dir/sub_dir2/sub_dir3/file_in_sub_dir_3.txt b/tests/auto/other/android/testdata/top_level_dir/sub_dir/sub_dir2/sub_dir3/file_in_sub_dir_3.txt new file mode 100644 index 0000000000..87b10bd8e6 --- /dev/null +++ b/tests/auto/other/android/testdata/top_level_dir/sub_dir/sub_dir2/sub_dir3/file_in_sub_dir_3.txt @@ -0,0 +1 @@ +FooBar -- cgit v1.2.3