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.