Tracker: Fix regression from hrev58264

From Code simplifications a4a5800e5f

In file panel switching dirs using the menu field got broken.

Change-Id: I2e9d75ba62082be27a85dbfa12e30a324f9fb440
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8501
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This commit is contained in:
John Scipione 2024-10-22 16:36:22 -04:00 committed by waddlesplash
parent 53cab618ef
commit b230e1d06b

View File

@ -547,13 +547,15 @@ TFilePanel::SetTo(const entry_ref* ref)
if (ref == NULL)
return;
BEntry entry(ref);
entry_ref setToRef(*ref);
bool isDesktop = SwitchDirToDesktopIfNeeded(setToRef);
BEntry entry(&setToRef);
if (entry.InitCheck() != B_OK || !entry.IsDirectory())
return;
entry_ref _ref(*ref);
PoseView()->SetIsDesktop(SwitchDirToDesktopIfNeeded(_ref));
SwitchDirMenuTo(&_ref);
PoseView()->SetIsDesktop(isDesktop);
PoseView()->SwitchDir(&setToRef);
SwitchDirMenuTo(&setToRef);
AddShortcut('H', B_COMMAND_KEY, new BMessage(kSwitchToHome));
// our shortcut got possibly removed because the home