Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
5.15.12, 6.6.0
-
-
e55d7fa1e (dev), 20bf08f01 (6.8)
Description
When a drive is removed on Linux the QStorageInfo should update the ‘valid’ information to 'false' for empty path. Currently this is not done and it’s not possible to detect if the drive has been removed or not.
qstorageinfo_unix.cpp:
void QStorageInfoPrivate::initRootPath() ... if (rootPath.isEmpty()) return; ...
On Windows the value is reset correctly:
qstorageinfo_win.cpp:
void QStorageInfoPrivate::initRootPath() ... if (path.isEmpty()) { valid = ready = false; return; } ...
The attached example can be used to reproduce the issue. The correct path needs to be set for the media in main.cpp.
Attachments
For Gerrit Dashboard: QTBUG-129689 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
595911,1 | QStorageInfo/Unix: reset the valid state when doStat()ing again | tqtc/lts-6.5 | qt/tqtc-qtbase | Status: NEW | 0 | 0 |