Details
Description
If mounted only internal storage on device, QStorageInfo for this storage is invalid and rootPath is empty.
Example internal storage mounted to /storage/sdcard0:
QStorageInfo storage = QStorageInfo("/storage/sdcard0"); qDebug() << "rootPath:" << storage.rootPath(); qDebug() << "name:" << storage.name(); qDebug() << "fileSystemType:" << storage.fileSystemType(); qDebug() << "size:" << storage.bytesTotal()/1000/1000 << "MB"; qDebug() << "availableSize:" << storage.bytesAvailable()/1000/1000 << "MB";
Output:
rootPath: ""
name: ""
fileSystemType: ""
size: 0 MB
availableSize: 0 MB
If we insert external sdcard it works correctly:
Output:
rootPath: "/storage/sdcard0"
name: ""
fileSystemType: "fuse"
size: 2205 MB
availableSize: 1538 MB
Attachments
For Gerrit Dashboard: QTBUG-60215 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
228079,9 | Fix QStorageIterator where the last line in /proc/mounts is skipped | 5.11 | qt/qtbase | Status: MERGED | +2 | 0 |
230790,1 | Fix QStorageIterator where the last line in /proc/mounts is skipped | dev | qt/qtbase | Status: ABANDONED | 0 | 0 |