Tracker: Cancel type-ahead filtering on esc

Otherwise esc closes the file panel.

Differentiate between type-ahead and ref filtering in pose view
which is why this was not working in e.g. Expander a ref filter
was set so filtering was also set. We only want to cancel
type-ahead filtering on esc, not ref filtering.

Refer to 'ref filtering' as simply filtering e.g. IsFiltering()
and refer to type-ahead filtering explicity when that is meant.
Rename methods and variables to make it clear whether we're
referring to ref filtering or type-ahead filtering.

If we are ref filtering fill out the filtered pose list again
after stopping type-ahead filtering so that we don't get an empty
file panel in e.g. Expander on esc.

Fixes #13151

Change-Id: I96faf98c3b68d3bcb3d3892c3511ae2449c2f8a4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8689
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
This commit is contained in:
John Scipione
2024-12-18 18:55:05 +00:00
committed by waddlesplash
parent c95edc2ba1
commit 10b1abbfde
3 changed files with 106 additions and 108 deletions
+1 -1
View File
@@ -150,7 +150,7 @@ key_down_filter(BMessage* message, BHandler** handler, BMessageFilter* filter)
if (modifiers == 0 && key == B_ESCAPE) { if (modifiers == 0 && key == B_ESCAPE) {
if (view->ActivePose() != NULL) if (view->ActivePose() != NULL)
view->CommitActivePose(false); view->CommitActivePose(false);
else if (view->IsFiltering()) else if (view->IsTypeAheadFiltering())
looper->PostMessage(B_CANCEL, *handler); looper->PostMessage(B_CANCEL, *handler);
else else
looper->PostMessage(kCancelButton); looper->PostMessage(kCancelButton);
+94 -99
View File
@@ -269,7 +269,7 @@ BPoseView::BPoseView(Model* model, uint32 viewMode)
fIsWatchingDateFormatChange(false), fIsWatchingDateFormatChange(false),
fHasPosesInClipboard(false), fHasPosesInClipboard(false),
fCursorCheck(false), fCursorCheck(false),
fFiltering(false), fTypeAheadFiltering(false),
fFilterStrings(4, true), fFilterStrings(4, true),
fLastFilterStringCount(1), fLastFilterStringCount(1),
fLastFilterStringLength(0), fLastFilterStringLength(0),
@@ -1152,7 +1152,7 @@ BPoseView::CommitActivePose(bool saveChanges)
BPose* activePose = ActivePose(); BPose* activePose = ActivePose();
if (activePose != NULL) { if (activePose != NULL) {
int32 index = fPoseList->IndexOf(ActivePose()); int32 index = fPoseList->IndexOf(ActivePose());
if (fFiltering) if (IsFiltering())
index = fFilteredPoseList->IndexOf(ActivePose()); index = fFilteredPoseList->IndexOf(ActivePose());
BPoint loc(0, index * fListElemHeight); BPoint loc(0, index * fListElemHeight);
@@ -1162,7 +1162,7 @@ BPoseView::CommitActivePose(bool saveChanges)
activePose->Commit(saveChanges, loc, this, index); activePose->Commit(saveChanges, loc, this, index);
BPose* pose = fActivePose; BPose* pose = fActivePose;
fActivePose = NULL; fActivePose = NULL;
if (fFiltering && !FilterPose(pose)) if (IsFiltering() && !FilterPose(pose))
RemoveFilteredPose(pose, index); RemoveFilteredPose(pose, index);
} }
} }
@@ -1951,10 +1951,10 @@ BPoseView::CreatePoses(Model** models, PoseInfo* poseInfoArray, int32 count,
switch (ViewMode()) { switch (ViewMode()) {
case kListMode: case kListMode:
{ {
AddPoseToList(fPoseList, !fFiltering, insertionSort, pose, AddPoseToList(fPoseList, !IsFiltering(), insertionSort, pose, viewBounds,
viewBounds, listViewScrollBy, forceDraw, &poseIndex); listViewScrollBy, forceDraw, &poseIndex);
if (fFiltering && FilterPose(pose)) { if (IsFiltering() && FilterPose(pose)) {
AddPoseToList(fFilteredPoseList, true, insertionSort, pose, AddPoseToList(fFilteredPoseList, true, insertionSort, pose,
viewBounds, listViewScrollBy, forceDraw, &poseIndex); viewBounds, listViewScrollBy, forceDraw, &poseIndex);
} }
@@ -2040,14 +2040,13 @@ BPoseView::ShouldShowPose(const Model* model, const PoseInfo* poseInfo)
return false; return false;
// check filter before adding item // check filter before adding item
if (!fRefFilter) if (!IsFiltering())
return true; return true;
struct stat_beos stat; struct stat_beos stat;
convert_to_stat_beos(model->StatBuf(), &stat); convert_to_stat_beos(model->StatBuf(), &stat);
return fRefFilter->Filter(model->EntryRef(), model->Node(), &stat, return fRefFilter->Filter(model->EntryRef(), model->Node(), &stat, model->MimeType());
model->MimeType());
} }
@@ -2335,8 +2334,8 @@ BPoseView::MessageReceived(BMessage* message)
case B_CANCEL: case B_CANCEL:
if (FSClipboardHasRefs()) if (FSClipboardHasRefs())
FSClipboardClear(); FSClipboardClear();
else if (fFiltering) if (IsTypeAheadFiltering())
StopFiltering(); StopTypeAheadFiltering();
break; break;
case kCancelSelectionToClipboard: case kCancelSelectionToClipboard:
@@ -2448,8 +2447,7 @@ BPoseView::MessageReceived(BMessage* message)
BPose* pose = fSelectionList->FirstItem(); BPose* pose = fSelectionList->FirstItem();
if (pose != NULL) { if (pose != NULL) {
BPoint where(0, BPoint where(0, CurrentPoseList()->IndexOf(pose) * fListElemHeight);
CurrentPoseList()->IndexOf(pose) * fListElemHeight);
pose->EditFirstWidget(where, this); pose->EditFirstWidget(where, this);
} }
break; break;
@@ -2678,14 +2676,12 @@ BPoseView::MessageReceived(BMessage* message)
case kTypeAheadFilteringChanged: case kTypeAheadFilteringChanged:
{ {
TrackerSettings settings; TrackerSettings settings;
bool typeAheadFiltering; bool typeAheadFilter;
if (message->FindBool("TypeAheadFiltering", if (message->FindBool("TypeAheadFiltering", &typeAheadFilter) == B_OK) {
&typeAheadFiltering) == B_OK) { settings.SetTypeAheadFiltering(typeAheadFilter);
settings.SetTypeAheadFiltering(typeAheadFiltering); if (IsTypeAheadFiltering() && !typeAheadFilter)
StopTypeAheadFiltering();
} }
if (fFiltering && !typeAheadFiltering)
StopFiltering();
break; break;
} }
} }
@@ -2762,13 +2758,13 @@ BPoseView::RemoveColumn(BColumn* columnToRemove, bool runAlert)
fStateNeedsSaving = true; fStateNeedsSaving = true;
if (fFiltering) { if (IsFiltering()) {
// the column we removed might just be the one that was used to filter // the column we removed might just be the one that was used to filter
int32 poseCount = fFilteredPoseList->CountItems(); int32 poseCount = fFilteredPoseList->CountItems();
for (int32 i = poseCount - 1; i >= 0; i--) { for (int32 index = poseCount - 1; index >= 0; index--) {
BPose* pose = fFilteredPoseList->ItemAt(i); BPose* pose = fFilteredPoseList->ItemAt(index);
if (!FilterPose(pose)) if (!FilterPose(pose))
RemoveFilteredPose(pose, i); RemoveFilteredPose(pose, index);
} }
} }
@@ -2839,11 +2835,9 @@ BPoseView::AddColumn(BColumn* newColumn, const BColumn* after)
fStateNeedsSaving = true; fStateNeedsSaving = true;
if (fFiltering) { if (IsFiltering()) {
// the column we added might just add new poses to be showed // the column we added might just add new poses to be showed
fFilteredPoseList->MakeEmpty(); RebuildFilteringPoseList();
fFiltering = false;
StartFiltering();
} }
return true; return true;
@@ -3084,8 +3078,8 @@ BPoseView::SetViewMode(uint32 newMode)
// toggle view layout between listmode and non-listmode, if necessary // toggle view layout between listmode and non-listmode, if necessary
BContainerWindow* window = ContainerWindow(); BContainerWindow* window = ContainerWindow();
if (oldMode == kListMode) { if (oldMode == kListMode) {
if (fFiltering) if (IsTypeAheadFiltering())
ClearFilter(); ClearTypeAheadFiltering();
if (window != NULL) if (window != NULL)
window->HideAttributesMenu(); window->HideAttributesMenu();
@@ -3289,7 +3283,7 @@ BPoseView::UpdatePosesClipboardModeFromClipboard(BMessage* clipboardReport)
if (!fullInvalidateNeeded) { if (!fullInvalidateNeeded) {
if (ViewMode() == kListMode) { if (ViewMode() == kListMode) {
if (fFiltering) if (IsFiltering())
pose = fFilteredPoseList->FindPose(&clipNode->node, &foundNodeIndex); pose = fFilteredPoseList->FindPose(&clipNode->node, &foundNodeIndex);
if (pose != NULL) { if (pose != NULL) {
@@ -3447,7 +3441,7 @@ BPoseView::NewFolder(const BMessage* message)
BPose* pose = EntryCreated(targetModel->NodeRef(), &nodeRef, ref.name, BPose* pose = EntryCreated(targetModel->NodeRef(), &nodeRef, ref.name,
&index); &index);
if (fFiltering) { if (IsFiltering()) {
if (fFilteredPoseList->FindPose(&nodeRef, &index) == NULL) { if (fFilteredPoseList->FindPose(&nodeRef, &index) == NULL) {
float scrollBy = 0; float scrollBy = 0;
BRect bounds = Bounds(); BRect bounds = Bounds();
@@ -5659,7 +5653,7 @@ BPoseView::EntryMoved(const BMessage* message)
BPose* pose = fPoseList->FindPose(&itemNode, &index); BPose* pose = fPoseList->FindPose(&itemNode, &index);
int32 poseListIndex = index; int32 poseListIndex = index;
bool visible = true; bool visible = true;
if (fFiltering) if (IsFiltering())
visible = fFilteredPoseList->FindPose(&itemNode, &index) != NULL; visible = fFilteredPoseList->FindPose(&itemNode, &index) != NULL;
if (pose != NULL) { if (pose != NULL) {
@@ -5683,7 +5677,7 @@ BPoseView::EntryMoved(const BMessage* message)
pose->UpdateAllWidgets(index, loc, this); pose->UpdateAllWidgets(index, loc, this);
poseModel->CloseNode(); poseModel->CloseNode();
_CheckPoseSortOrder(fPoseList, pose, poseListIndex); _CheckPoseSortOrder(fPoseList, pose, poseListIndex);
if (fFiltering) { if (IsFiltering()) {
if (!visible && FilterPose(pose)) { if (!visible && FilterPose(pose)) {
BRect bounds = Bounds(); BRect bounds = Bounds();
float scrollBy = 0; float scrollBy = 0;
@@ -5854,7 +5848,7 @@ BPoseView::AttributeChanged(const BMessage* message)
&index) != NULL; &index) != NULL;
int32 poseListIndex = index; int32 poseListIndex = index;
if (fFiltering) if (IsFiltering())
visible = fFilteredPoseList->FindPose(poseModel->NodeRef(), &index) != NULL; visible = fFilteredPoseList->FindPose(poseModel->NodeRef(), &index) != NULL;
BPoint loc(0, index * fListElemHeight); BPoint loc(0, index * fListElemHeight);
@@ -5871,7 +5865,7 @@ BPoseView::AttributeChanged(const BMessage* message)
visible); visible);
} }
poseModel->CloseNode(); poseModel->CloseNode();
if (fFiltering) { if (IsFiltering()) {
if (!visible && FilterPose(pose)) { if (!visible && FilterPose(pose)) {
visible = true; visible = true;
float scrollBy = 0; float scrollBy = 0;
@@ -5890,7 +5884,7 @@ BPoseView::AttributeChanged(const BMessage* message)
uint32 attrHash = AttrHashString(attrName, info.type); uint32 attrHash = AttrHashString(attrName, info.type);
if (attrHash == PrimarySort() || attrHash == SecondarySort()) { if (attrHash == PrimarySort() || attrHash == SecondarySort()) {
_CheckPoseSortOrder(fPoseList, pose, poseListIndex); _CheckPoseSortOrder(fPoseList, pose, poseListIndex);
if (fFiltering && visible) if (IsFiltering() && visible)
_CheckPoseSortOrder(fFilteredPoseList, pose, index); _CheckPoseSortOrder(fFilteredPoseList, pose, index);
} }
} else { } else {
@@ -5904,7 +5898,7 @@ BPoseView::AttributeChanged(const BMessage* message)
|| sAttrColumnMap[i].attrHash == SecondarySort()) { || sAttrColumnMap[i].attrHash == SecondarySort()) {
if ((fields & sAttrColumnMap[i].fieldMask) != 0) { if ((fields & sAttrColumnMap[i].fieldMask) != 0) {
_CheckPoseSortOrder(fPoseList, pose, poseListIndex); _CheckPoseSortOrder(fPoseList, pose, poseListIndex);
if (fFiltering && visible) if (IsFiltering() && visible)
_CheckPoseSortOrder(fFilteredPoseList, pose, index); _CheckPoseSortOrder(fFilteredPoseList, pose, index);
break; break;
} }
@@ -6611,13 +6605,15 @@ BPoseView::KeyDown(const char* bytes, int32 count)
} }
case B_RETURN: case B_RETURN:
if (fFiltering && CountSelected() == 0) if (IsFiltering() && CountSelected() == 0)
SelectPose(fFilteredPoseList->FirstItem(), 0); SelectPose(fFilteredPoseList->FirstItem(), 0);
OpenSelection(); OpenSelection();
if (fFiltering && (modifiers() & B_SHIFT_KEY) != 0) if (IsTypeAheadFiltering() && (modifiers() & B_SHIFT_KEY) != 0) {
StopFiltering(); // Discard type-ahead filtering by opening a pose with Shift+Return.
StopTypeAheadFiltering();
}
break; break;
@@ -6716,7 +6712,7 @@ BPoseView::KeyDown(const char* bytes, int32 count)
case B_BACKSPACE: case B_BACKSPACE:
{ {
if (fFiltering) { if (IsTypeAheadFiltering()) {
BString* lastString = fFilterStrings.LastItem(); BString* lastString = fFilterStrings.LastItem();
if (lastString->Length() == 0) { if (lastString->Length() == 0) {
int32 stringCount = fFilterStrings.CountItems(); int32 stringCount = fFilterStrings.CountItems();
@@ -6728,7 +6724,7 @@ BPoseView::KeyDown(const char* bytes, int32 count)
lastString->TruncateChars(lastString->CountChars() - 1); lastString->TruncateChars(lastString->CountChars() - 1);
fCountView->RemoveFilterCharacter(); fCountView->RemoveFilterCharacter();
FilterChanged(); TypeAheadFilteringChanged();
break; break;
} }
@@ -6782,7 +6778,7 @@ BPoseView::KeyDown(const char* bytes, int32 count)
fFilterStrings.LastItem()->AppendChars(bytes, 1); fFilterStrings.LastItem()->AppendChars(bytes, 1);
fCountView->AddFilterCharacter(bytes); fCountView->AddFilterCharacter(bytes);
FilterChanged(); TypeAheadFilteringChanged();
break; break;
} }
@@ -8034,7 +8030,7 @@ BPoseView::DeletePose(const node_ref* itemNode, BPose* pose, int32 index)
fPoseList->RemoveItemAt(index); fPoseList->RemoveItemAt(index);
bool visible = true; bool visible = true;
if (fFiltering) { if (IsFiltering()) {
if (fFilteredPoseList->FindPose(itemNode, &index) != NULL) if (fFilteredPoseList->FindPose(itemNode, &index) != NULL)
fFilteredPoseList->RemoveItemAt(index); fFilteredPoseList->RemoveItemAt(index);
else else
@@ -8355,7 +8351,7 @@ BPoseView::ClearPoses()
{ {
CommitActivePose(); CommitActivePose();
SavePoseLocations(); SavePoseLocations();
ClearFilter(); ClearTypeAheadFiltering();
// clear all pose lists // clear all pose lists
fPoseList->MakeEmpty(); fPoseList->MakeEmpty();
@@ -8495,10 +8491,8 @@ BPoseView::Refresh()
AddPoses(TargetModel()); AddPoses(TargetModel());
TargetModel()->CloseNode(); TargetModel()->CloseNode();
if (fRefFilter != NULL) { if (IsFiltering())
fFiltering = false; RebuildFilteringPoseList();
StartFiltering();
}
Invalidate(); Invalidate();
ResetOrigin(); ResetOrigin();
@@ -9339,7 +9333,7 @@ BPoseView::_CheckPoseSortOrder(PoseList* poseList, BPose* pose, int32 oldIndex)
return; return;
} }
if (fFiltering && poseList != fFilteredPoseList) { if (IsFiltering() && poseList != fFilteredPoseList) {
poseList->AddItem(pose, newIndex); poseList->AddItem(pose, newIndex);
return; return;
} }
@@ -9571,7 +9565,7 @@ BPoseView::SortPoses()
PoseList::Private(fPoseList).AsBList()->Items()); PoseList::Private(fPoseList).AsBList()->Items());
std::stable_sort(poses, &poses[fPoseList->CountItems()], std::stable_sort(poses, &poses[fPoseList->CountItems()],
PoseComparator(this)); PoseComparator(this));
if (fFiltering) { if (IsFiltering()) {
poses = reinterpret_cast<BPose**>( poses = reinterpret_cast<BPose**>(
PoseList::Private(fFilteredPoseList).AsBList()->Items()); PoseList::Private(fFilteredPoseList).AsBList()->Items());
std::stable_sort(poses, &poses[fFilteredPoseList->CountItems()], std::stable_sort(poses, &poses[fFilteredPoseList->CountItems()],
@@ -10352,7 +10346,7 @@ BPoseView::RemoveFilteredPose(BPose* pose, int32 index)
void void
BPoseView::FilterChanged() BPoseView::TypeAheadFilteringChanged()
{ {
if (ViewMode() != kListMode) if (ViewMode() != kListMode)
return; return;
@@ -10360,25 +10354,21 @@ BPoseView::FilterChanged()
int32 stringCount = fFilterStrings.CountItems(); int32 stringCount = fFilterStrings.CountItems();
int32 length = fFilterStrings.LastItem()->CountChars(); int32 length = fFilterStrings.LastItem()->CountChars();
if (!fFiltering && (length > 0 || fRefFilter != NULL)) { if (!IsTypeAheadFiltering() && length > 0) {
StartFiltering(); StartTypeAheadFiltering();
} else if (fFiltering && stringCount == 1 && length == 0 && fRefFilter == NULL) { } else if (IsTypeAheadFiltering() && stringCount == 1 && length == 0) {
ClearFilter(); ClearTypeAheadFiltering();
} else if (fLastFilterStringCount > stringCount
|| (fLastFilterStringCount == stringCount && fLastFilterStringLength > length)) {
// something was removed, need to start over
RebuildFilteringPoseList();
Invalidate();
} else { } else {
if (fLastFilterStringCount > stringCount int32 poseCount = fFilteredPoseList->CountItems();
|| (fLastFilterStringCount == stringCount && fLastFilterStringLength > length) for (int32 index = poseCount - 1; index >= 0; index--) {
|| fRefFilter != NULL) { BPose* pose = fFilteredPoseList->ItemAt(index);
// something was removed, need to start over if (!FilterPose(pose))
fFilteredPoseList->MakeEmpty(); RemoveFilteredPose(pose, index);
fFiltering = false;
StartFiltering();
} else {
int32 poseCount = fFilteredPoseList->CountItems();
for (int32 i = poseCount - 1; i >= 0; i--) {
BPose* pose = fFilteredPoseList->ItemAt(i);
if (!FilterPose(pose))
RemoveFilteredPose(pose, i);
}
} }
} }
@@ -10410,10 +10400,10 @@ BPoseView::UpdateAfterFilterChange()
bool bool
BPoseView::FilterPose(BPose* pose) BPoseView::FilterPose(BPose* pose)
{ {
if (!fFiltering || pose == NULL) if (pose == NULL || !(IsFiltering() || IsTypeAheadFiltering()))
return false; return false;
if (fRefFilter != NULL) { if (IsFiltering()) {
PoseInfo poseInfo; PoseInfo poseInfo;
ReadPoseInfo(pose->TargetModel(), &poseInfo); ReadPoseInfo(pose->TargetModel(), &poseInfo);
if (pose->TargetModel()->OpenNode() != B_OK) if (pose->TargetModel()->OpenNode() != B_OK)
@@ -10457,46 +10447,34 @@ BPoseView::FilterPose(BPose* pose)
void void
BPoseView::StartFiltering() BPoseView::StartTypeAheadFiltering()
{ {
if (fFiltering) if (fTypeAheadFiltering)
return; return;
fFiltering = true; fTypeAheadFiltering = true;
int32 poseCount = fPoseList->CountItems();
for (int32 i = 0; i < poseCount; i++) {
BPose* pose = fPoseList->ItemAt(i);
if (FilterPose(pose))
fFilteredPoseList->AddItem(pose);
else
EnsurePoseUnselected(pose);
}
RebuildFilteringPoseList();
Invalidate(); Invalidate();
} }
bool
BPoseView::IsFiltering() const
{
return fFiltering;
}
void void
BPoseView::StopFiltering() BPoseView::StopTypeAheadFiltering()
{ {
ClearFilter(); ClearTypeAheadFiltering();
UpdateAfterFilterChange(); UpdateAfterFilterChange();
} }
void void
BPoseView::ClearFilter() BPoseView::ClearTypeAheadFiltering()
{ {
if (!fFiltering) if (!fTypeAheadFiltering)
return; return;
fTypeAheadFiltering = false;
fCountView->CancelFilter(); fCountView->CancelFilter();
int32 stringCount = fFilterStrings.CountItems(); int32 stringCount = fFilterStrings.CountItems();
@@ -10507,15 +10485,32 @@ BPoseView::ClearFilter()
fLastFilterStringCount = 1; fLastFilterStringCount = 1;
fLastFilterStringLength = 0; fLastFilterStringLength = 0;
if (fRefFilter == NULL) if (IsFiltering())
fFiltering = false; RebuildFilteringPoseList();
fFilteredPoseList->MakeEmpty();
Invalidate(); Invalidate();
} }
void
BPoseView::RebuildFilteringPoseList()
{
fFilteredPoseList->MakeEmpty();
int32 poseCount = fPoseList->CountItems();
for (int32 index = 0; index < poseCount; index++) {
BPose* pose = fPoseList->ItemAt(index);
if (pose == NULL)
continue;
if (FilterPose(pose))
fFilteredPoseList->AddItem(pose);
else
EnsurePoseUnselected(pose);
}
}
void void
BPoseView::ExcludeTrashFromSelection() BPoseView::ExcludeTrashFromSelection()
{ {
+11 -8
View File
@@ -412,7 +412,8 @@ public:
void StopWatchDateFormatChange(); void StopWatchDateFormatChange();
// type ahead filtering // type ahead filtering
bool IsFiltering() const; bool IsFiltering() const { return fRefFilter != NULL; };
bool IsTypeAheadFiltering() const { return fTypeAheadFiltering; };
void UpdateDateColumns(BMessage*); void UpdateDateColumns(BMessage*);
virtual void AdaptToVolumeChange(BMessage*); virtual void AdaptToVolumeChange(BMessage*);
@@ -655,12 +656,14 @@ protected:
// typeahead filtering // typeahead filtering
void EnsurePoseUnselected(BPose* pose); void EnsurePoseUnselected(BPose* pose);
void RemoveFilteredPose(BPose* pose, int32 index); void RemoveFilteredPose(BPose* pose, int32 index);
void FilterChanged(); void TypeAheadFilteringChanged();
void UpdateAfterFilterChange(); void UpdateAfterFilterChange();
bool FilterPose(BPose* pose); bool FilterPose(BPose* pose);
void StartFiltering(); void StartTypeAheadFiltering();
void StopFiltering(); void StopTypeAheadFiltering();
void ClearFilter(); void ClearTypeAheadFiltering();
void RebuildFilteringPoseList();
PoseList* CurrentPoseList() const; PoseList* CurrentPoseList() const;
// misc // misc
@@ -805,7 +808,7 @@ private:
bool fIsWatchingDateFormatChange : 1; bool fIsWatchingDateFormatChange : 1;
bool fHasPosesInClipboard : 1; bool fHasPosesInClipboard : 1;
bool fCursorCheck : 1; bool fCursorCheck : 1;
bool fFiltering : 1; bool fTypeAheadFiltering : 1;
BObjectList<BString> fFilterStrings; BObjectList<BString> fFilterStrings;
int32 fLastFilterStringCount; int32 fLastFilterStringCount;
@@ -1232,7 +1235,7 @@ BPoseView::SetRefFilter(BRefFilter* filter)
{ {
fRefFilter = filter; fRefFilter = filter;
if (filter != NULL) if (filter != NULL)
FilterChanged(); RebuildFilteringPoseList();
} }
@@ -1281,7 +1284,7 @@ BPoseView::SetHasPosesInClipboard(bool hasPoses)
inline PoseList* inline PoseList*
BPoseView::CurrentPoseList() const BPoseView::CurrentPoseList() const
{ {
return fFiltering ? fFilteredPoseList : fPoseList; return (IsFiltering() || IsTypeAheadFiltering()) ? fFilteredPoseList : fPoseList;
} }