diff options
author | Assam Boudjelthia <[email protected]> | 2023-05-10 11:23:20 +0300 |
---|---|---|
committer | Assam Boudjelthia <[email protected]> | 2023-05-11 13:38:32 +0300 |
commit | f1778f34e0848bdcbe471c91f6ee7f9146e2d9f8 (patch) | |
tree | 84d867624bfbfd5cc85248ec5cc5133e43ed2f77 /src/plugins/platforms/android/androidcontentfileengine.cpp | |
parent | 4710fb3528873e630b6b1e34c947a1c811e0e854 (diff) |
Android: fix QDir::entryInfoList() with content URIs
Correctly return only the fileName portion from
AndroidContentFileEngineIterator::currentFileName(); which
QDirIteratorPrivate::matchesFilters() expects when looking for matches
of the file pattern provided to the QDirIterator.
Fixes: QTBUG-112738
Pick-to: 6.5 6.2 5.15
Change-Id: I98dba2df014b27f33cd7e54fab3ad2de8c7c1750
Reviewed-by: Ville Voutilainen <[email protected]>
Diffstat (limited to 'src/plugins/platforms/android/androidcontentfileengine.cpp')
-rw-r--r-- | src/plugins/platforms/android/androidcontentfileengine.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/platforms/android/androidcontentfileengine.cpp b/src/plugins/platforms/android/androidcontentfileengine.cpp index ed2238c87cb..c86bbeae776 100644 --- a/src/plugins/platforms/android/androidcontentfileengine.cpp +++ b/src/plugins/platforms/android/androidcontentfileengine.cpp @@ -308,14 +308,14 @@ QString AndroidContentFileEngineIterator::currentFileName() const { if (m_index < 0 || m_index > m_files.size()) return QString(); - // Returns a full path since contstructing a content path from the file name - // and a tree URI only will not point to a valid file URI. - return m_files.at(m_index)->uri().toString(); + return m_files.at(m_index)->name(); } QString AndroidContentFileEngineIterator::currentFilePath() const { - return currentFileName(); + if (m_index < 0 || m_index > m_files.size()) + return QString(); + return m_files.at(m_index)->uri().toString(); } // Start of Cursor |