Tracker: Restore IsFiltering() to IsRefFiltering() or IsTypeAheadFiltering()
Add IsRefFiltering() and IsFiltering() is once again either kind of filtering: ref or type-ahead. Use IsRefFiltering() in a few places, otherwise use IsFiltering() to restore filtering code so that it gets triggered on either kind of filter. Make the filtering methods inline to avoid function call overhead. Fixes #19317 Change-Id: I27407ca33e8f2b967975c8a8ef8de83105442bd4 Reviewed-on: https://review.haiku-os.org/c/haiku/+/8715 Reviewed-by: waddlesplash <[email protected]> Haiku-Format: Haiku-format Bot <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
ffed6d0bff
commit
3c18c3d5c6
@@ -2040,7 +2040,7 @@ BPoseView::ShouldShowPose(const Model* model, const PoseInfo* poseInfo)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// check filter before adding item
|
// check filter before adding item
|
||||||
if (!IsFiltering())
|
if (fRefFilter == NULL)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
struct stat_beos stat;
|
struct stat_beos stat;
|
||||||
@@ -8026,10 +8026,9 @@ BPoseView::DeletePose(const node_ref* itemNode, BPose* pose, int32 index)
|
|||||||
|
|
||||||
bool visible = true;
|
bool visible = true;
|
||||||
if (IsFiltering()) {
|
if (IsFiltering()) {
|
||||||
if (fFilteredPoseList->FindPose(itemNode, &index) != NULL)
|
visible = fFilteredPoseList->FindPose(itemNode, &index) != NULL;
|
||||||
|
if (visible)
|
||||||
fFilteredPoseList->RemoveItemAt(index);
|
fFilteredPoseList->RemoveItemAt(index);
|
||||||
else
|
|
||||||
visible = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fMimeTypeListIsDirty = true;
|
fMimeTypeListIsDirty = true;
|
||||||
@@ -8486,7 +8485,7 @@ BPoseView::Refresh()
|
|||||||
AddPoses(TargetModel());
|
AddPoses(TargetModel());
|
||||||
TargetModel()->CloseNode();
|
TargetModel()->CloseNode();
|
||||||
|
|
||||||
if (IsFiltering())
|
if (IsRefFiltering())
|
||||||
RebuildFilteringPoseList();
|
RebuildFilteringPoseList();
|
||||||
|
|
||||||
Invalidate();
|
Invalidate();
|
||||||
@@ -10393,10 +10392,10 @@ BPoseView::UpdateAfterFilterChange()
|
|||||||
bool
|
bool
|
||||||
BPoseView::FilterPose(BPose* pose)
|
BPoseView::FilterPose(BPose* pose)
|
||||||
{
|
{
|
||||||
if (pose == NULL || !(IsFiltering() || IsTypeAheadFiltering()))
|
if (pose == NULL || !IsFiltering())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (IsFiltering()) {
|
if (IsRefFiltering()) {
|
||||||
PoseInfo poseInfo;
|
PoseInfo poseInfo;
|
||||||
ReadPoseInfo(pose->TargetModel(), &poseInfo);
|
ReadPoseInfo(pose->TargetModel(), &poseInfo);
|
||||||
if (pose->TargetModel()->OpenNode() != B_OK)
|
if (pose->TargetModel()->OpenNode() != B_OK)
|
||||||
@@ -10478,7 +10477,7 @@ BPoseView::ClearTypeAheadFiltering()
|
|||||||
fLastFilterStringCount = 1;
|
fLastFilterStringCount = 1;
|
||||||
fLastFilterStringLength = 0;
|
fLastFilterStringLength = 0;
|
||||||
|
|
||||||
if (IsFiltering())
|
if (IsRefFiltering())
|
||||||
RebuildFilteringPoseList();
|
RebuildFilteringPoseList();
|
||||||
|
|
||||||
Invalidate();
|
Invalidate();
|
||||||
|
|||||||
@@ -412,8 +412,9 @@ public:
|
|||||||
void StopWatchDateFormatChange();
|
void StopWatchDateFormatChange();
|
||||||
|
|
||||||
// type ahead filtering
|
// type ahead filtering
|
||||||
bool IsFiltering() const { return fRefFilter != NULL; };
|
inline bool IsFiltering() const { return IsRefFiltering() || IsTypeAheadFiltering(); };
|
||||||
bool IsTypeAheadFiltering() const { return fTypeAheadFiltering; };
|
inline bool IsRefFiltering() const { return fRefFilter != NULL; };
|
||||||
|
inline bool IsTypeAheadFiltering() const { return fTypeAheadFiltering; };
|
||||||
|
|
||||||
void UpdateDateColumns(BMessage*);
|
void UpdateDateColumns(BMessage*);
|
||||||
virtual void AdaptToVolumeChange(BMessage*);
|
virtual void AdaptToVolumeChange(BMessage*);
|
||||||
@@ -1284,7 +1285,7 @@ BPoseView::SetHasPosesInClipboard(bool hasPoses)
|
|||||||
inline PoseList*
|
inline PoseList*
|
||||||
BPoseView::CurrentPoseList() const
|
BPoseView::CurrentPoseList() const
|
||||||
{
|
{
|
||||||
return (IsFiltering() || IsTypeAheadFiltering()) ? fFilteredPoseList : fPoseList;
|
return IsFiltering() ? fFilteredPoseList : fPoseList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user