[gspell/wip/entry: 6/6] Entry: simplify signal connections



commit 2b58ba3aefa7a5996c4b00eada5c6140bc038a4b
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri Oct 28 18:05:07 2016 +0200

    Entry: simplify signal connections
    
    gspell_entry is destroyed when gtk_entry is destroyed. gtk_entry cannot
    send signals after gspell_entry is destroyed.

 gspell/gspell-entry.c |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)
---
diff --git a/gspell/gspell-entry.c b/gspell/gspell-entry.c
index 2d30af9..06d3e73 100644
--- a/gspell/gspell-entry.c
+++ b/gspell/gspell-entry.c
@@ -196,17 +196,15 @@ set_entry (GspellEntry *gspell_entry,
        g_assert (gspell_entry->entry == NULL);
        gspell_entry->entry = gtk_entry;
 
-       g_signal_connect_object (gtk_entry,
-                                "changed",
-                                G_CALLBACK (changed_before_cb),
-                                gspell_entry,
-                                0);
-
-       g_signal_connect_object (gtk_entry,
-                                "changed",
-                                G_CALLBACK (changed_after_cb),
-                                gspell_entry,
-                                G_CONNECT_AFTER);
+       g_signal_connect (gtk_entry,
+                         "changed",
+                         G_CALLBACK (changed_before_cb),
+                         gspell_entry);
+
+       g_signal_connect_after (gtk_entry,
+                               "changed",
+                               G_CALLBACK (changed_after_cb),
+                               gspell_entry);
 
        g_assert (gspell_entry->notify_attributes_handler_id == 0);
        gspell_entry->notify_attributes_handler_id =


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]