GNOME Bugzilla – Bug 709118
network: Update forget button sensitivity when rows are destroyed
Last modified: 2013-10-01 13:12:08 UTC
Another bug I noticed in this area. Also applies to 3.8.
Created attachment 256119 [details] [review] network: Update forget button sensitivity when rows are destroyed Doesn't make sense to keep it sensitive after the dialog returns OK. This also avoids using finalized objects if the forget button is clicked after some previously checked rows were destroyed because their connection got removed elsewhere.
Review of attachment 256119 [details] [review]: ::: panels/network/net-device-wifi.c @@ +1445,3 @@ + rows = g_object_steal_data (G_OBJECT (forget), "rows"); + rows = g_list_remove (rows, where_row_was); + g_object_set_data_full (G_OBJECT (forget), "rows", rows, (GDestroyNotify)g_list_free); Wouldn't it be better to have a destroy notify function that unref'ed the elements, rather than doing that separately. g_object_set_data_full (G_OBJECT (forget), "rows", rows, (GDestroyNotify)free_rows); static void free_rows (gpointer data) { rows = ...; g_list_foreach (rows, row_weak_unref, ...); g_list_free (rows); } ?
(In reply to comment #2) > g_list_foreach (rows, row_weak_unref, ...); > g_list_free (rows); And those last 2 can actually be: g_list_free_full(rows, row_weak_unref, ...);
Created attachment 256167 [details] [review] network: Update forget button sensitivity when rows are destroyed -- It's actually much simpler with g_signal_connect_object() (again...)
Review of attachment 256167 [details] [review]: Looks fine.
Attachment 256167 [details] pushed as fb9d98b - network: Update forget button sensitivity when rows are destroyed