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
+24 -17
View File
@@ -1576,28 +1576,35 @@ 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);
entry_ref ref; entry_ref ref;
entry.GetRef(&ref); entry.GetRef(&ref);
node_ref dirNode; // If the volume is mounted at a directory of a persistent volume, we don't
dirNode.device = ref.device; // want it on the desktop or in the disks window.
dirNode.node = ref.directory; BVolume parentVolume(ref.device);
if (parentVolume.InitCheck() == B_OK && parentVolume.IsPersistent())
return;
BPose *pose = EntryCreated(&dirNode, &itemNode, ref.name, 0); node_ref itemNode;
root.GetNodeRef(&itemNode);
if (pose && watchIndividually) { node_ref dirNode;
// make sure volume names still get watched, even though dirNode.device = ref.device;
// they are on the desktop which is not their physical parent dirNode.node = ref.directory;
pose->TargetModel()->WatchVolumeAndMountPoint(B_WATCH_NAME | B_WATCH_STAT
| B_WATCH_ATTR, this); BPose *pose = EntryCreated(&dirNode, &itemNode, ref.name, 0);
}
if (pose && watchIndividually) {
// make sure volume names still get watched, even though
// they are on the desktop which is not their physical parent
pose->TargetModel()->WatchVolumeAndMountPoint(B_WATCH_NAME | B_WATCH_STAT
| B_WATCH_ATTR, this);
} }
} }