After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 733186 - [PATCH] Extend account tree view search function
[PATCH] Extend account tree view search function
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: User Interface General
git-master
Other All
: Normal enhancement
: future
Assigned To: gnucash-ui-maint
gnucash-ui-maint
Depends on:
Blocks:
 
 
Reported: 2014-07-15 06:26 UTC by Jethro Beekman
Modified: 2018-06-29 23:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Extend account tree view search function (3.25 KB, patch)
2014-07-15 06:26 UTC, Jethro Beekman
committed Details | Review

Description Jethro Beekman 2014-07-15 06:26:53 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).
Comment 1 Jethro Beekman 2014-07-15 06:35:28 UTC
Quick note to add that this is intended to be of primary use in the import account selection dialog.
Comment 2 Geert Janssens 2014-09-03 21:00:12 UTC
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 !
Comment 3 Jethro Beekman 2014-09-03 21:09:15 UTC
Yeah that should not be const.

Freeing is correct: https://developer.gnome.org/gtk2/stable/GtkTreeModel.html#gtk-tree-model-get
Comment 4 Geert Janssens 2014-09-04 08:27:40 UTC
That confirms it indeed. Thanks!
Comment 5 John Ralls 2018-06-29 23:32:00 UTC
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.