Don't show packagefs on desktop or in disks window

More generally: Any volume that is mounted at a directory of a
persistent volume is not shown on the desktop or the disks window any
longer.
This commit is contained in:
Ingo Weinhold
2011-07-17 16:55:12 +02:00
parent 207a28efee
commit c98a59c653
+11 -4
View File
@@ -1576,9 +1576,8 @@ BPoseView::CreateVolumePose(BVolume *volume, bool watchIndividually)
} }
BDirectory root; BDirectory root;
if (volume->GetRootDirectory(&root) == B_OK) { if (volume->GetRootDirectory(&root) != B_OK)
node_ref itemNode; return;
root.GetNodeRef(&itemNode);
BEntry entry; BEntry entry;
root.GetEntry(&entry); root.GetEntry(&entry);
@@ -1586,6 +1585,15 @@ BPoseView::CreateVolumePose(BVolume *volume, bool watchIndividually)
entry_ref ref; entry_ref ref;
entry.GetRef(&ref); entry.GetRef(&ref);
// If the volume is mounted at a directory of a persistent volume, we don't
// want it on the desktop or in the disks window.
BVolume parentVolume(ref.device);
if (parentVolume.InitCheck() == B_OK && parentVolume.IsPersistent())
return;
node_ref itemNode;
root.GetNodeRef(&itemNode);
node_ref dirNode; node_ref dirNode;
dirNode.device = ref.device; dirNode.device = ref.device;
dirNode.node = ref.directory; dirNode.node = ref.directory;
@@ -1599,7 +1607,6 @@ BPoseView::CreateVolumePose(BVolume *volume, bool watchIndividually)
| B_WATCH_ATTR, this); | B_WATCH_ATTR, this);
} }
} }
}
void void