summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorey Berla <corey@berla.me>2022-08-23 13:49:56 -0700
committerAntónio Fernandes <antoniof@gnome.org>2022-09-01 22:22:49 +0000
commit997548ca6e33bf4ad5b1fa7b5ef5a3bc3c8a5f8a (patch)
tree7478f03323455cea4b4bf07e2a2048c8db5e7a38
parent0690c01884c7241d24c58e5f41af393ed1e5a1a7 (diff)
downloadnautilus-997548ca6e33bf4ad5b1fa7b5ef5a3bc3c8a5f8a.tar.gz
places-view: Make sure signals are really disconnected
I screwed up in 8c296a91c8a3e410edcb6471fa713eeaa3133d25 by flipping the instance and data when disconnecting the signal. Let's just use g_signal_connect_object to make this automatic. (cherry picked from commit 7854c9895bfcf4d045444fb3d4862b583032c439)
-rw-r--r--src/nautilus-places-view.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/nautilus-places-view.c b/src/nautilus-places-view.c
index 007f53c2c..a9e36dbd9 100644
--- a/src/nautilus-places-view.c
+++ b/src/nautilus-places-view.c
@@ -146,10 +146,6 @@ nautilus_places_view_finalize (GObject *object)
NautilusPlacesView *self = (NautilusPlacesView *) object;
NautilusPlacesViewPrivate *priv = nautilus_places_view_get_instance_private (self);
- g_signal_handlers_disconnect_by_func (self, loading_cb, priv->places_view);
- g_signal_handlers_disconnect_by_func (self, open_location_cb, priv->places_view);
- g_signal_handlers_disconnect_by_func (self, show_error_message_cb, priv->places_view);
-
g_clear_object (&priv->location);
g_clear_object (&priv->search_query);
@@ -396,20 +392,14 @@ nautilus_places_view_init (NautilusPlacesView *self)
gtk_widget_show (priv->places_view);
gtk_box_append (GTK_BOX (self), priv->places_view);
- g_signal_connect_swapped (priv->places_view,
- "notify::loading",
- G_CALLBACK (loading_cb),
- self);
+ g_signal_connect_object (priv->places_view, "notify::loading",
+ G_CALLBACK (loading_cb), self, G_CONNECT_SWAPPED);
- g_signal_connect_swapped (priv->places_view,
- "open-location",
- G_CALLBACK (open_location_cb),
- self);
+ g_signal_connect_object (priv->places_view, "open-location",
+ G_CALLBACK (open_location_cb), self, G_CONNECT_SWAPPED);
- g_signal_connect_swapped (priv->places_view,
- "show-error-message",
- G_CALLBACK (show_error_message_cb),
- self);
+ g_signal_connect_object (priv->places_view, "show-error-message",
+ G_CALLBACK (show_error_message_cb), self, G_CONNECT_SWAPPED);
}
NautilusPlacesView *