Tracker: Fix regression Copy To writable volumes

Regression was introduced in hrev56978 (Tracker read-only patch)
after R1B4.

This check is bad on Copy To/Move To operations because destWindow
is same as source window in these cases. This check only worked on
right-click drag Copy here/Move here since there is a separate
destWindow in this case.

Checking destFolder's volume read-only fixes the regression
because destFolder, unlike destWindow, should always be valid.

Fixes #18657

Change-Id: I4721bae34840d916e47f2a395d553e7254acaec5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7137
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
John Scipione 2023-11-24 11:15:51 -05:00 committed by waddlesplash
parent 45f8be4190
commit 32d1cd8e82

View File

@ -5108,7 +5108,8 @@ BPoseView::MoveSelectionInto(Model* destFolder, BContainerWindow* srcWindow,
}
// can't copy to read-only volume
if (destWindow->PoseView()->TargetVolumeIsReadOnly()) {
BVolume destVolume(destFolder->NodeRef()->device);
if (destVolume.InitCheck() == B_OK && destVolume.IsReadOnly()) {
BAlert* alert = new BAlert("",
B_TRANSLATE("You can't move or copy items to read-only volumes."),
B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);