GtkTreeView resets SearchColumn when changing models
Submitted by iain
Assigned to gtk..@..tk.org
Link to original bug (#792927)
Description
The Gtk documentation says that
"The search column is reset to -1 when the model is changed."
https://developer.gnome.org/gtk3/stable/GtkTreeView.html#gtk-tree-view-set-search-column
except it doesn't. It resets it to the first column that contains something that can be translated into a string.
It is set to -1 here https://git.gnome.org/browse/gtk+/tree/gtk/gtktreeview.c#n11022 but if a model is set then it recalculates the in this clause shortly afterwards https://git.gnome.org/browse/gtk+/tree/gtk/gtktreeview.c#n11037
This means that setting the model after setting search-column to -1 reenables the feature, in apparently contrast to the documentation.
It could be argued that this is merely a documentation bug, but IMO this should be an opt-in feature, rather than opt-out as it is now (and as implied by elsewhere in the code and the documentation)
Version: 3.93.x