Tracker: AttributeChanged() on current pose list, fixes #19770.

When filtering this is the filtered pose list, else this is the
pose list in list mode or the visible pose list in icon mode.

Remove filtered pose list fixup from hrev44493 to resync the lists
afterwords which fixes issue with duplicate symlinked files appearing
on other volumes that appear to be created when saving linked files
while filtering.

Change-Id: I6d6c85fe222960f47cc206322eeb4441f7fa73aa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10970
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
This commit is contained in:
John Scipione
2026-05-13 14:14:34 +00:00
parent 286eb01997
commit f1e9c36fcb
+8 -26
View File
@@ -5931,6 +5931,9 @@ BPoseView::StopWatchingParentsOf(const entry_ref* ref)
bool
BPoseView::AttributeChanged(const BMessage* message)
{
ASSERT(ContainerWindow() != NULL);
ASSERT(CurrentPoseList() != NULL);
node_ref itemNode;
message->FindInt32("device", &itemNode.device);
message->FindInt64("node", (int64*)&itemNode.node);
@@ -5957,7 +5960,7 @@ BPoseView::AttributeChanged(const BMessage* message)
int32 index;
attr_info info;
PoseList* posesFound = fPoseList->FindAllPoses(&itemNode);
PoseList* posesFound = CurrentPoseList()->FindAllPoses(&itemNode);
int32 posesCount = posesFound->CountItems();
for (int i = 0; i < posesCount; i++) {
BPose* pose = posesFound->ItemAt(i);
@@ -5984,12 +5987,9 @@ BPoseView::AttributeChanged(const BMessage* message)
continue;
}
bool visible = fPoseList->FindPose(poseModel->NodeRef(), &index) != NULL;
bool visible = CurrentPoseList()->FindPose(poseModel->NodeRef(), &index) != NULL;
int32 poseListIndex = index;
if (IsFiltering())
visible = fFilteredPoseList->FindPose(poseModel->NodeRef(), &index) != NULL;
BPoint poseLoc;
if (ViewMode() == kListMode)
poseLoc.Set(0, index * fListElemHeight);
@@ -6029,28 +6029,12 @@ BPoseView::AttributeChanged(const BMessage* message)
}
poseModel->CloseNode();
if (IsFiltering()) {
if (!visible && FilterPose(pose)) {
visible = true;
float scrollBy = 0;
BRect bounds = Bounds();
AddPoseToList(fFilteredPoseList, true, true, pose, bounds, scrollBy, true);
continue;
} else if (visible && !FilterPose(pose)) {
RemoveFilteredPose(pose, index);
continue;
}
}
if (attrName != NULL) {
// note: the following code is wrong, because this sort of hashing
// may overlap and we get aliasing
uint32 attrHash = AttrHashString(attrName, info.type);
if (attrHash == PrimarySort() || attrHash == SecondarySort()) {
_CheckPoseSortOrder(fPoseList, pose, poseListIndex);
if (IsFiltering() && visible)
_CheckPoseSortOrder(fFilteredPoseList, pose, index);
}
if (attrHash == PrimarySort() || attrHash == SecondarySort())
_CheckPoseSortOrder(CurrentPoseList(), pose, poseListIndex);
} else {
int32 fields;
if (message->FindInt32("fields", &fields) != B_OK)
@@ -6060,9 +6044,7 @@ BPoseView::AttributeChanged(const BMessage* message)
uint32 attrHash = sAttrColumnMap[i].attrHash;
if (attrHash == PrimarySort() || attrHash == SecondarySort()) {
if ((fields & sAttrColumnMap[i].fieldMask) != 0) {
_CheckPoseSortOrder(fPoseList, pose, poseListIndex);
if (IsFiltering() && visible)
_CheckPoseSortOrder(fFilteredPoseList, pose, index);
_CheckPoseSortOrder(CurrentPoseList(), pose, poseListIndex);
break;
}
}