GNOME Bugzilla – Bug 733186
[PATCH] Extend account tree view search function
Last modified: 2018-06-29 23:32:00 UTC
Created attachment 280687 [details] [review] Extend account tree view search function The current (GTK default) tree view search only allows prefix-based searching on a single column, which is not very convenient. This patch implements a custom search for the account tree view that does a substring match on the name, code and description fields of an account. Compare with the default at https://git.gnome.org/browse/gtk+/tree/gtk/gtktreeview.c#n15385 Similar patches could be implement for the other customized tree views (in particular, the security tree view default column is rather useless for searches).
Quick note to add that this is intended to be of primary use in the import account selection dialog.
Comment on attachment 280687 [details] [review] Extend account tree view search function Thank you for your patch. It does make quick search in an account tree much more flexible ! There was one build error because g_free is called on str, which is declared const gchar*. I have removed the const, assuming str really has to be freed. This seemed to work fine. If you think this is wrong, please correct me. The improved search behaviour will appear first in gnucash 2.8. Thanks again and I'm looking forward to your next contribution !
Yeah that should not be const. Freeing is correct: https://developer.gnome.org/gtk2/stable/GtkTreeModel.html#gtk-tree-model-get
That confirms it indeed. Thanks!
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=733186. Please update any external references or bookmarks.