GNOME Bugzilla – Bug 107748
rowrefs broken if it's row_inserted handler isn't connected first
Last modified: 2011-02-04 16:16:03 UTC
The RowReferences handling code connects a signal handler to ::row_inserted to keep up with inserted rows in the model. However, if this signal handler isn't connected as the first ::row_inserted signal handler on the TreeModel, things go horribly wrong. This happens, for example, if the user manages to connect a signal handler first. Attached testcase demonstrates the problem, we need a good and clean fix for this issue. As I have no clue how to fix this cleanly, I guess Jonathan should take a look at it (:
Created attachment 14817 [details] testcase
After talking with rambokid, we decided the best way to fix this is to have the GtkTreeModel provide class closures in gtk_tree_model_base_init() for row_inserted, row_deleted, row_reordered and make all those signals RUN_FIRST. Each closure will then fetch all row references used with this model and update them. We can then remove the proxy signal connects on the model, and gaurantee that we run the update before any other signal handler is run.
I will write up a patch and test this ASAP. This blocks the combo work (though I have a nasty workaround in there :).
Created attachment 18375 [details] [review] patch as sent to jrb and timj
Tentatively looks fine to me, but my closure-fu aint so hot. I'll defer to Tim's expertice as to whether or not it's right.
Reviewed by Tim. Committed on HEAD.