gnc-tree-view-account-filter

Chris Shoemaker c.shoemaker at cox.net
Sun Apr 24 15:09:26 EDT 2005


On Tue, Feb 15, 2005 at 07:05:34PM -0500, David Hampton wrote:
> On Mon, 2005-02-14 at 00:43 -0500, c.shoemaker at cox.net wrote:
> > >From the source:
> > ***********************
> > /*
> >  * Set the account view info data in use by the specified tree to
> >  * match the callers request.
> >  *
> >  * DRH - COMPATABILITY WARNING
> >  *
> >  * This function does not do anything with the 'include_type' field.
> >  * Should there be a automatic filter for backward compatability
> >  * that uses these flags, or should all uses of this be converted to
> >  * a eggtreemodelfilter?
> >  */
> > void
> > gnc_tree_view_account_set_view_info (GncTreeViewAccount *account_view,
> >                                      AccountViewInfo *avi)
> > 
> > ************************
> > 
> > I think I understand these two options.  I'd like to be able to filter
> > the account tree view by account types, so I think I need to do one of
> > these two options.  Are there any opinions on which one is better?
> 
> The include_type flags are the old mechanism used in gnucash1.x.  Most
> of the filtering in gnucash2.x is being done with eggtreemodelfilters.
> The account tree view already has a filter in place.  Any chance you
> could integrate this capability into that filter?  All that filter does,
> iirc, is hide the root node of the account tree so that what shows up
> are the first level nodes labeled Income, Expense, etc.
> 
> David
> 

David,
        BTW, in that patch list you're already looking at, I also
think I've addressed this issue, too.  But, it involved a fundamental
change in our use of the filter model.  Partly, this is because of
some limitations in GtkTreeModelFilter, like only being able to set
the visibility funtion *once* in the lifetime of the model.
        Since we have to keep the model around longer, we have to also
privatize the memory we give it for the visibility func.  So now, a
"refilter" operation is really "repopulate the filter-related fields
and call treemodelfilter_refilter", where before it was attempting to
reset the visibilty function in response to every refilter, which
didn't work in the egg version, and still doesn't work for the gtk
version.
        If you're factoring out stuff for a common gnctreeview, you
may want to consider also factoring out the functions that implement
the basemodel/filtermodel/sortmodel chaining.  That way, we could
connect a model to the treeview and automatically get the filter/sort
functionality if we later register the filter and/or sort functions.
        Just an idea...

-chris
        


More information about the gnucash-devel mailing list