Details
Description
QFile on Android unable to open file content:// with space in the name
In order to open file need to replace spaces to "%20".
Workaround:
#ifdef Q_OS_ANDROID // patch for files containing spaces etc const QString sep {"raw%3A%2F"}; if (fileName.startsWith("content://") && fileName.contains(sep)) { QString contentUrl = fileName.split(sep).at(0); QString rawUrl = fileName.split(sep).at(1); rawUrl.replace(" ", "%20"); fileName = contentUrl + sep + rawUrl; } #endif
Attachments
Issue Links
- duplicates
-
QTBUG-112738 QDir::entryInfoList() broken on Android when nameFilters used
- Closed
For Gerrit Dashboard: QTBUG-112663 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
475910,2 | Android: fix content url handling of filenames with spaces | dev | qt/qtbase | Status: MERGED | +2 | 0 |
476252,2 | Android: fix content url handling of filenames with spaces | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |
476253,4 | Android: fix content url handling of filenames with spaces | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |
476254,3 | Android: fix content url handling of filenames with spaces | tqtc/lts-5.15 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |