Tracker: Fix drop onto file assume parent directory regression.
Also fix a minor TODO regarding dropping file onto root dir. Regression from hrev59656, fixes #20069. Change-Id: I153539cb714b9a5872eca16da3aa4a8de25c0f64 Reviewed-on: https://review.haiku-os.org/c/haiku/+/10890 Reviewed-by: John Scipione <[email protected]> Tested-by: Commit checker robot <[email protected]> Haiku-Format: Haiku-format Bot <[email protected]>
This commit is contained in:
@@ -4898,8 +4898,6 @@ BPoseView::HandleDropCommon(BMessage* message, Model* targetModel, BPose* target
|
||||
|
||||
if (!wasHandled && poseView != NULL) {
|
||||
BPoint where = message->GetPoint("click_pt", B_ORIGIN);
|
||||
// TODO: removed check for root here need to do that, possibly at a
|
||||
// different level
|
||||
poseView->MoveSelectionTo(targetModel, dropPoint, srcWindow, where, moveMode);
|
||||
}
|
||||
|
||||
@@ -5234,6 +5232,14 @@ BPoseView::MoveSelectionTo(Model* model, BPoint dropPoint, BContainerWindow* src
|
||||
|
||||
ASSERT(model != NULL);
|
||||
|
||||
// use this directory unless we were passed a directory
|
||||
if (!(model->IsDirectory() || model->IsVirtualDirectory()))
|
||||
model = TargetModel();
|
||||
|
||||
// don't allow dropping files onto root
|
||||
if (model->IsRoot())
|
||||
return;
|
||||
|
||||
// make sure this window is a legal drop target
|
||||
if (srcWindow != window && !model->IsDropTarget())
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user