Tracker: Add Disks to Desktop nav menu if "Show Disks" setting is on.

Rename AddRootItemsIfNeeded() to AddVolumeItems().

Fixes #19720

Change-Id: I866b7364012b2d267809d9f49059ef531ec4a24f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9741
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: humdinger humdinger <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
John Scipione
2025-10-27 16:28:45 +00:00
committed by waddlesplash
parent 2eae07f9c4
commit 17a87a2077
2 changed files with 19 additions and 3 deletions
+2 -1
View File
@@ -128,7 +128,8 @@ protected:
void BuildVolumeMenu();
void AddOneItem(Model*);
void AddRootItemsIfNeeded();
void AddRootItem();
void AddVolumeItems();
void AddTrashItem();
static void SetTrackingHookDeep(BMenu*, bool (*)(BMenu*, void*), void*);
+17 -2
View File
@@ -431,7 +431,10 @@ BNavMenu::StartBuildingItemList()
fIteratingDesktop = true;
fContainer = DesktopPoseView::InitDesktopDirentIterator(0, startModel.EntryRef());
if (TrackerSettings().MountVolumesOntoDesktop())
AddRootItemsIfNeeded();
AddVolumeItems();
else if (TrackerSettings().ShowDisksIcon())
AddRootItem();
AddTrashItem();
} else if (startModel.IsTrash()) {
// the trash window needs to display a union of all the
@@ -470,7 +473,19 @@ BNavMenu::StartBuildingItemList()
void
BNavMenu::AddRootItemsIfNeeded()
BNavMenu::AddRootItem()
{
BEntry entry("/");
Model model(&entry);
if (model.InitCheck() != B_OK)
return;
AddOneItem(&model);
}
void
BNavMenu::AddVolumeItems()
{
BVolumeRoster roster;
roster.Rewind();