treelistmodel: Track the item in the row
authorBenjamin Otte <otte@redhat.com>
Sun, 19 Mar 2023 04:22:46 +0000 (05:22 +0100)
committerBenjamin Otte <otte@redhat.com>
Sun, 19 Mar 2023 05:55:05 +0000 (06:55 +0100)
commitbf55685000fd744a26eec61c07fd8aa3d084d54c
treefbf09509d4826f9cbd25bd6b50773afbb1fa3dac
parent9048e391b60e19ccefa0b9fe51c466d16b42dcc4
treelistmodel: Track the item in the row

That way, we can return the item even after the row is removed. This is
particularly relevant in ListItemFactory::unbind callbacks because they
often use gtk_tree_list_row_get_item() and user code never tracks
changes to this property.

A side effect of this is that the item will survive until the row gets
destroyed, but that's what users expect anyway, so we can live with it.

Related: #5646
gtk/gtktreelistmodel.c
testsuite/gtk/defaultvalue.c