Repository navigation
SearchView: use FilterModel - #406
danirabbit wants to merge 6 commits into
Conversation
leolost2605
left a comment
There was a problem hiding this comment.
Did you look at Gtk.StringFilter?
|
@leolost2605 I opened a branch here using StringFilter instead. The only thing is I'm not sure how we can also update |
leolost2605
left a comment
There was a problem hiding this comment.
Yeah I don't have a good idea for that either. We could just bind the query property to the pattern of every row. Right now that's a bit problematic because we actually have to do it for every row but eventually we could bind in list_view.bind and unbind in list_view.unbind which should scale much better and make the performance good AFAICT (though with the limited amout of search options performance shouldn't be bad right now either).
I wouldn't mind the current way it's done but unfortunately CustomFilter is always a bit tricky and in this case it would leak memory (see review comment)
| private bool filter_func (Gtk.ListBoxRow listbox_row) { | ||
| var search_text = search_entry.text; | ||
| if (search_text == "" || search_text == null) { | ||
| private bool filter_func (Object object) { |
There was a problem hiding this comment.
If the filter func is not static we will get a reference cycle :(
us -> filter model -> filter -> callback target (= us)
Uh oh!
There was an error while loading. Please reload this page.