OpenWithWindow: Fix crash at closing, and fix filtering
Following hrev44493, the way ShouldShowPose was used changed a bit, to harmonize with type ahead filtering. This updates OpenWithWindow to use a BRefFilter to do its filtering rather than overloading ShouldShowPose.
This commit is contained in:
@@ -648,6 +648,8 @@ OpenWithPoseView::InitDirentIterator(const entry_ref*)
|
|||||||
HideBarberPole();
|
HideBarberPole();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
SetRefFilter(new OpenWithRefFilter(fIterator, entryList,
|
||||||
|
(fHaveCommonPreferredApp ? &fPreferredRef : 0)));
|
||||||
return fIterator;
|
return fIterator;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -935,16 +937,25 @@ OpenWithPoseView::OpenWithRelationDescription(const Model* model,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
// #pragma mark -
|
||||||
OpenWithPoseView::ShouldShowPose(const Model* model, const PoseInfo* poseInfo)
|
|
||||||
{
|
|
||||||
OpenWithContainerWindow* window = ContainerWindow();
|
|
||||||
// filter for add_poses
|
|
||||||
if (!fIterator->CanOpenWithFilter(model, window->EntryList(),
|
|
||||||
fHaveCommonPreferredApp ? &fPreferredRef : 0))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return _inherited::ShouldShowPose(model, poseInfo);
|
|
||||||
|
OpenWithRefFilter::OpenWithRefFilter(SearchForSignatureEntryList* iterator,
|
||||||
|
const BMessage *entryList, entry_ref* preferredRef)
|
||||||
|
:
|
||||||
|
fIterator(iterator),
|
||||||
|
fEntryList(entryList),
|
||||||
|
fPreferredRef(preferredRef)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
OpenWithRefFilter::Filter(const entry_ref* ref, BNode* node, stat_beos* st,
|
||||||
|
const char* filetype)
|
||||||
|
{
|
||||||
|
Model *model = new Model(ref, true, true);
|
||||||
|
return fIterator->CanOpenWithFilter(model, fEntryList, fPreferredRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -252,8 +252,6 @@ class OpenWithPoseView : public BPoseView {
|
|||||||
// override to add selecting the default handling app
|
// override to add selecting the default handling app
|
||||||
// for selection
|
// for selection
|
||||||
|
|
||||||
virtual bool ShouldShowPose(const Model*, const PoseInfo*);
|
|
||||||
|
|
||||||
virtual void Pulse();
|
virtual void Pulse();
|
||||||
|
|
||||||
virtual void KeyDown(const char* bytes, int32 count);
|
virtual void KeyDown(const char* bytes, int32 count);
|
||||||
@@ -269,6 +267,21 @@ class OpenWithPoseView : public BPoseView {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class OpenWithRefFilter: public BRefFilter
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
OpenWithRefFilter(SearchForSignatureEntryList*, const BMessage*,
|
||||||
|
entry_ref*);
|
||||||
|
bool Filter(const entry_ref* ref, BNode* node, stat_beos* st,
|
||||||
|
const char* filetype);
|
||||||
|
|
||||||
|
private:
|
||||||
|
SearchForSignatureEntryList* fIterator;
|
||||||
|
const BMessage *fEntryList;
|
||||||
|
entry_ref* fPreferredRef;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class RelationCachingModelProxy {
|
class RelationCachingModelProxy {
|
||||||
public:
|
public:
|
||||||
RelationCachingModelProxy(Model* model);
|
RelationCachingModelProxy(Model* model);
|
||||||
|
|||||||
Reference in New Issue
Block a user