GNOME Bugzilla – Bug 637018
[GtkComboBoxText] Add checks for id-column/entry-text-column >= 0
Last modified: 2010-12-13 19:29:10 UTC
I've found myself in the situation where GtkComboBoxText from .ui files didn't have id-column set, and the warnings I got were scary. Rather than failing all over the place without explanation, better check for it before. That's actually what the code does in these functions for all other results.
Created attachment 176232 [details] [review] [GtkComboBoxText] Add checks for id-column/entry-text-column >= 0 If the GtkComboBoxText doesn't have id-column or entry-text-column set for some reason (value -1), better warn and return. Else, unrelated assertions fail, and warnings from gtk_tree_model_get_column_type() are printed, which are not really obvious.
Created attachment 176233 [details] [review] [GtkComboBoxText] Add checks for id-column/entry-text-column >= 0 If the GtkComboBoxText doesn't have id-column or entry-text-column set for some reason (value -1), better warn and return. Else, unrelated assertions fail, and warnings from gtk_tree_model_get_column_type() are printed, which are not really obvious.
Comment on attachment 176232 [details] [review] [GtkComboBoxText] Add checks for id-column/entry-text-column >= 0 Of course I always need to post the wrong patch. New one uses g_return_val_if_fails() when needed.
Review of attachment 176233 [details] [review]: Looks fine to me.
Attachment 176233 [details] pushed as 0290834 - [GtkComboBoxText] Add checks for id-column/entry-text-column >= 0