Commit a3c66110 authored by David Redondo's avatar David Redondo 🏎
Browse files

Include StorageVolumes by default

We are searching for a StorageDrive to see if it is on a HardDisk or or some
other type of device. However on some setups a Volume will not have StorageDrive
as an ancestor, this is for example the case when using lvm. So let's include
every volume by default and exclude only those for which we find a Drive that is
not a hard disk.


(cherry picked from commit 8747897a)
parent 77868f03
......@@ -192,18 +192,19 @@ void DisksPlugin::addDevice(const Solid::Device& device)
if (!access || !volume || volume->isIgnored()) {
return;
}
Solid::Device drive = device;
while (drive.isValid() && !drive.is<Solid::StorageDrive>()) {
// Only exlude volumes if we know that they are for sure not on a hard disk
while (drive.isValid()) {
if (drive.is<Solid::StorageDrive>()) {
auto type = drive.as<Solid::StorageDrive>()->driveType();
if (type == Solid::StorageDrive::HardDisk) {
break;
} else {
return;
}
}
drive = drive.parent();
}
if (!drive.isValid()) {
return;
}
if (drive.as<Solid::StorageDrive>()->driveType() != Solid::StorageDrive::HardDisk) {
return;
}
if (access->filePath() != QString()) {
auto block = device.as<Solid::Block>();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment