GNOME Bugzilla – Bug 703054
Simplify signal handlers tracking
Last modified: 2013-06-27 14:01:21 UTC
We currently keep track of a lot of signals by id, but by using g_signal_connect_object() and g_signal_handlers_disconnect_by_func() we can reduce considerably the needed bookeeping.
Created attachment 247725 [details] [review] main-toolbar: Simplify signal handlers tracking Use g_signal_connect_object() to make sure that signals are disconnected when the toolbar is destroyed and use g_signal_handlers_disconnect_by_func() otherwise. This allows us to get rid of all the signal id member fields.
Created attachment 247726 [details] [review] embed: Simplify signal handlers tracking Use g_signal_connect_object() to make sure that signals are disconnected when the toolbar is destroyed and use g_signal_handlers_disconnect_by_func() otherwise. This allows us to get rid of all the signal id member fields.
Created attachment 247727 [details] [review] view-container: Simplify signal handlers tracking Use g_signal_connect_object() to make sure that signals are disconnected when the toolbar is destroyed and use g_signal_handlers_disconnect_by_func() otherwise. This allows us to get rid of all the signal id member fields.
Created attachment 247728 [details] [review] organize-collection-model: Simplify signal handlers tracking Use g_signal_connect_object() to make sure that signals are disconnected when the toolbar is destroyed and use g_signal_handlers_disconnect_by_func() otherwise. This allows us to get rid of all the signal id member fields.
Created attachment 247729 [details] [review] load-more-button: Simplify signal handlers tracking Use g_signal_connect_object() to make sure that signals are disconnected when the toolbar is destroyed and use g_signal_handlers_disconnect_by_func() otherwise. This allows us to get rid of all the signal id member fields.
Review of attachment 247725 [details] [review]: Thanks for the patch. Committed after making the following style changes. ::: src/photos-main-toolbar.c @@ +217,3 @@ + g_signal_connect_object (priv->col_mngr, "active-changed", + G_CALLBACK (photos_main_toolbar_active_changed), + self, 0); Better to put each argument on its own line. @@ +390,3 @@ + g_signal_connect_object (priv->sel_cntrlr, "selection-changed", + G_CALLBACK (photos_main_toolbar_set_toolbar_title), + self, G_CONNECT_SWAPPED); Ditto. @@ +487,3 @@ + g_signal_connect_object (priv->src_mngr, "active-changed", + G_CALLBACK (photos_main_toolbar_set_toolbar_title), + self, G_CONNECT_SWAPPED); Ditto. @@ +493,3 @@ + g_signal_connect_object (priv->mode_cntrlr, "window-mode-changed", + G_CALLBACK (photos_main_toolbar_window_mode_changed), + self, G_CONNECT_SWAPPED); Ditto. @@ +498,3 @@ + g_signal_connect_object (priv->sel_cntrlr, "selection-mode-changed", + G_CALLBACK (photos_main_toolbar_reset_toolbar_mode), + self, G_CONNECT_SWAPPED); Ditto.
Review of attachment 247726 [details] [review]: Thanks for the patch. Committed after making the following minor changes. ::: src/photos-embed.c @@ -200,3 @@ - g_signal_handler_disconnect (priv->monitor, priv->no_results_change_id); - priv->no_results_change_id = 0; - } Can remove this extra new line too. @@ +224,3 @@ + g_signal_connect_object (priv->monitor, "changes-pending", + G_CALLBACK (photos_embed_changes_pending), + self, G_CONNECT_SWAPPED); Better to have each argument on its own line.
Review of attachment 247727 [details] [review]: Thanks for the patch. Committed after making the following minor style changes. ::: src/photos-view-container.c @@ +112,3 @@ + "value-changed", + G_CALLBACK (photos_view_container_view_changed), + self, G_CONNECT_SWAPPED); Better to put each argument on its own line. @@ +118,3 @@ + "notify::visible", + G_CALLBACK (photos_view_container_view_changed), + self, G_CONNECT_SWAPPED); Ditto.
Review of attachment 247728 [details] [review]: Thanks for the patch. Committed after making the following minor changes. ::: src/photos-organize-collection-model.c @@ +213,3 @@ + g_signal_connect_object (priv->manager, "object-removed", + G_CALLBACK (photos_organize_collection_model_object_removed), + self, 0); Better to put each argument on its own line.
Review of attachment 247729 [details] [review]: Thanks for the patch. Committed after making the following style change. ::: src/photos-load-more-button.c @@ +121,3 @@ + g_signal_connect_object (priv->offset_cntrlr, "count-changed", + G_CALLBACK (photos_load_more_button_count_changed), + self, 0); Better to put each argument on its own line.
Thanks a lot for cleaning these up.