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:
@@ -1576,9 +1576,8 @@ BPoseView::CreateVolumePose(BVolume *volume, bool watchIndividually)
|
||||
}
|
||||
|
||||
BDirectory root;
|
||||
if (volume->GetRootDirectory(&root) == B_OK) {
|
||||
node_ref itemNode;
|
||||
root.GetNodeRef(&itemNode);
|
||||
if (volume->GetRootDirectory(&root) != B_OK)
|
||||
return;
|
||||
|
||||
BEntry entry;
|
||||
root.GetEntry(&entry);
|
||||
@@ -1586,6 +1585,15 @@ BPoseView::CreateVolumePose(BVolume *volume, bool watchIndividually)
|
||||
entry_ref 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;
|
||||
dirNode.device = ref.device;
|
||||
dirNode.node = ref.directory;
|
||||
@@ -1598,7 +1606,6 @@ BPoseView::CreateVolumePose(BVolume *volume, bool watchIndividually)
|
||||
pose->TargetModel()->WatchVolumeAndMountPoint(B_WATCH_NAME | B_WATCH_STAT
|
||||
| B_WATCH_ATTR, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user