Sculpt: un-inspect failed USB storage

With this patch, the user is able to re-gain access to the inspect view
by toggling the inspect button of a file system unrelated to the failed
USB storage device.

Fixes #4090
This commit is contained in:
Norman Feske 2021-04-26 16:50:19 +02:00
parent 2db94b8438
commit 8617e5cee0

View File

@ -87,7 +87,18 @@ struct Sculpt::Usb_storage_device : List_model<Usb_storage_device>::Element,
* This method is called as response to a failed USB-block-driver
* initialization.
*/
void discard_usb_block_drv() { Storage_device::state = FAILED; }
void discard_usb_block_drv()
{
Storage_device::state = FAILED;
/*
* Exclude device from set of inspected file systems. This is needed
* whenever the USB block driver fails sometime after an inspect button
* is activated.
*/
for_each_partition([&] (Partition &partition) {
partition.file_system.inspected = false; });
}
bool discarded() const { return Storage_device::state == FAILED; }