[nautilus/cherry-pick-7854c989] places-view: Make sure signals are really disconnected
- From: Corey Berla <coreyberla src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/cherry-pick-7854c989] places-view: Make sure signals are really disconnected
- Date: Thu, 1 Sep 2022 14:28:32 +0000 (UTC)
commit da47305e6f70fa8bdb81aedbabf0a304b3bcc450
Author: Corey Berla <corey berla me>
Date: Tue Aug 23 13:49:56 2022 -0700
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)
src/nautilus-places-view.c | 22 ++++++----------------
1 file 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 *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]