reuse of filter by... for budgets

Chris Shoemaker c.shoemaker at cox.net
Fri Dec 30 23:12:53 EST 2005


On Fri, Dec 30, 2005 at 04:42:23PM -0500, Chris Shoemaker wrote:
> [ snip plan for factoring code out of gnc-plugin-page-account-tree ]
>
> If it works there, maybe all
> these callbacks and the dialog creation should move to some
> "gnc_tree_view_account_types" home.

Of course, the page save/restore functions have a lot of common code,
too.  And then... Aha!  It's now become completely obvious where all
these functions belong: gnc-tree-view-account.  That's precisely what
all these function have in common, even more so than account-types.
And that's exactly why page-plugin-budget and page-plugin-account-tree
both want to use them -- they both use gnc-tree-view-account.

The page-plugins should be handling the stuff that's unique to the
_page_, and delegating the tree_view stuff to the GncTreeViewAccount.
It just so happens that's most of the work - for both the account-tree
page and the budget page.  And further benefit: putting the functions
in gnc-tree-view-account results in less casting since all these
helper functions have to *know* their dealing with a
GncTreeViewAccount.  In gnc-tree-view-account, we can just type them
as doing so.

-chris


More information about the gnucash-devel mailing list