Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.5.1
-
None
-
NDK: r25b;
-
-
76619eae4 (dev), 3e7d4f165 (6.5.2), d48a15a59 (6.5), 6a2956172 (6.6)
Description
QFileInfo::fileName() returns filename with assets:/ prefix
Folder with structure as https://github.com/MerginMaps/input/tree/master/app/android/assets/qgis-data
with code snipped
// srcPath = "assets:/qgis-data" QDir srcDir( srcPath ); const QFileInfoList fileInfoList = srcDir.entryInfoList( QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot | QDir::Hidden ); foreach ( const QFileInfo &info, fileInfoList ) { QString fileName = info.fileName(); qDebug() << "src: " << srcPath + "/" + fileName; }
produces invalid paths for QFile::copy (double assets:/)
... D Input : "2023-06-05T08:40:53.572Z src: assets:/qgis-data/assets:/proj_custom D Input : "2023-06-05T08:40:53.573Z src: assets:/qgis-data/assets:/resources ...
When workaround as such is applied, it QFile::copy works as before
if (fileName.startsWith("assets:/")) { fileName.remove(0, 8); }
Attachments
Issue Links
- duplicates
-
QTBUG-114576 QFileInfo("assets:/path/to/file").fileName() returns wrong name
- Closed
- is duplicated by
-
QTBUG-114669 [REG: 5->6] android: QDir::entryList returns full path for contents under assets:/
- Closed
For Gerrit Dashboard: QTBUG-114219 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
485267,8 | Don't add prefix for BaseName | dev | qt/qtbase | Status: MERGED | +2 | 0 |
485828,2 | Don't add prefix for BaseName | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
485829,3 | Don't add prefix for BaseName | 6.5.2 | qt/qtbase | Status: MERGED | +2 | 0 |
485830,3 | Don't add prefix for BaseName | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |