Skip to content

Commit

Permalink
Android: fix QDir::entryInfoList() with content URIs
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Issam-b committed May 11, 2023
1 parent 4710fb3 commit f1778f3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/plugins/platforms/android/androidcontentfileengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f1778f3

Please sign in to comment.