[gnome-builder] egg-signal-group: Simplify connect helper
- From: Garrett Regier <gregier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] egg-signal-group: Simplify connect helper
- Date: Thu, 14 May 2015 00:59:11 +0000 (UTC)
commit 05a874bab012f5467d1064d3907db3b0a69ccba6
Author: Garrett Regier <garrettregier gmail com>
Date: Wed May 13 16:06:52 2015 -0700
egg-signal-group: Simplify connect helper
contrib/egg/egg-signal-group.c | 21 ++++++---------------
1 files changed, 6 insertions(+), 15 deletions(-)
---
diff --git a/contrib/egg/egg-signal-group.c b/contrib/egg/egg-signal-group.c
index d800929..099c0b9 100644
--- a/contrib/egg/egg-signal-group.c
+++ b/contrib/egg/egg-signal-group.c
@@ -566,23 +566,14 @@ egg_signal_group_connect_full (EggSignalGroup *self,
NULL, NULL, FALSE) != 0);
g_return_if_fail (callback != NULL);
- if (!is_object)
- {
- if ((flags & G_CONNECT_SWAPPED) != 0)
- closure = g_cclosure_new_swap (callback, data, notify);
- else
- closure = g_cclosure_new (callback, data, notify);
- }
+ if ((flags & G_CONNECT_SWAPPED) != 0)
+ closure = g_cclosure_new_swap (callback, data, notify);
else
- {
- g_assert (data != NULL);
- g_assert (notify == NULL);
+ closure = g_cclosure_new (callback, data, notify);
- if ((flags & G_CONNECT_SWAPPED) != 0)
- closure = g_cclosure_new_object_swap (callback, data);
- else
- closure = g_cclosure_new_object (callback, data);
- }
+ /* This is what g_cclosure_new_object() does */
+ if (is_object)
+ g_object_watch_closure (data, closure);
handler = g_slice_new0 (SignalHandler);
handler->detailed_signal = g_intern_string (detailed_signal);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]