[GNC-dev] gnc-currency-edit and entry completion
dpj-gcash at mhtsa.us
Thu Sep 10 16:37:44 EDT 2020
To get myself oriented with the code and my development setup, I decided
I'd look at bug 102787 (https://bugs.gnucash.org/show_bug.cgi?id=102787).
It turns out that gnc-currency-edit has everything needed underneath
it. However, it short-circuits the machinery. It listens for a
"changed" signal, which fires as soon as the user types into the combo
box. The handler (gnc_currency_edit_active_changed()) calls
gnc_currency_edit_get_currency() expecting the currency selection to be
complete. However, in that routine, gtk_combo_box_get_active_iter()
returns "false", so gnc_currency_edit_get_currency() returns the locale
default currency, gnc_currency_edit_active_changed() pushes the locale
default's mnemonic into the combo box, and GTK entry completion never
has a chance to offer options.
If instead, gnc_currency_edit_get_currency() returns NULL and
gnc_currency_edit_active_changed() simply returns if it gets NULL, then
the entry completion goes ahead and works.
I see roughly 15 references to gnc_currency_edit_get_currency(). I
haven't visited each to teach them how to deal with a NULL return from
that function, so I don't have a patch set yet. Before doing so, I
wanted to check that others agree with this change.
More information about the gnucash-devel