- /* Mark disks containing mounted partitions as themselves mounted */
- BOOST_FOREACH (Disk& i, disks) {
- if (!i.whole) {
- continue;
- }
- BOOST_FOREACH (Disk& j, disks) {
- if (j.mounted && starts_with(j.device, i.device)) {
- LOG_DISK("Marking %1 as mounted because %2 is", i.device, j.device);
- i.mounted = true;
- }
- }
- }
-
- /* Make a list of the PRT codes of mounted, synthesized disks */
- vector<string> mounted_synths;
- BOOST_FOREACH (Disk& i, disks) {
- if (!i.real && i.mounted) {
- LOG_DISK("Found a mounted synth %1 with %2", i.device, i.prt);
- mounted_synths.push_back (i.prt);
- }
- }
-
- /* Mark containers of those mounted synths as themselves mounted */
- BOOST_FOREACH (Disk& i, disks) {
- if (i.real && find(mounted_synths.begin(), mounted_synths.end(), i.prt) != mounted_synths.end()) {
- LOG_DISK("Marking %1 (%2) as mounted because it contains a mounted synth", i.device, i.prt);
- i.mounted = true;
- }
- }
-
- vector<Drive> drives;
- BOOST_FOREACH (Disk& i, disks) {
- if (i.whole) {
- /* A whole disk that is not a container for a mounted synth */
- LOG_DISK("Adding drive: %1 %2 %3 %4 %5", i.device, i.size, i.mounted ? "mounted" : "unmounted", i.vendor.get_value_or("[none]"), i.model.get_value_or("[none]"));
- drives.push_back(Drive(i.device, i.size, i.mounted, i.vendor, i.model));
- }
- }
- return drives;