[yelp] Fix various calls to g_signal_emit(_by_name); one was causing a crash



commit 14154b158d5ad680d654c5109f6708279fab6cfb
Author: Shaun McCance <shaunm gnome org>
Date:   Fri May 7 12:30:04 2010 -0500

    Fix various calls to g_signal_emit(_by_name); one was causing a crash

 libyelp/yelp-location-entry.c |    3 ++-
 libyelp/yelp-view.c           |   26 +++++++++++++-------------
 src/yelp-application.c        |    2 +-
 3 files changed, 16 insertions(+), 15 deletions(-)
---
diff --git a/libyelp/yelp-location-entry.c b/libyelp/yelp-location-entry.c
index 2520257..d76e829 100644
--- a/libyelp/yelp-location-entry.c
+++ b/libyelp/yelp-location-entry.c
@@ -479,6 +479,7 @@ location_entry_start_search (YelpLocationEntry *entry,
 static void
 location_entry_cancel_search (YelpLocationEntry *entry)
 {
+    gboolean ret;
     YelpLocationEntryPrivate *priv = GET_PRIV (entry);
     GdkEventFocus *event = g_new0 (GdkEventFocus, 1);
     priv->search_mode = FALSE;
@@ -487,7 +488,7 @@ location_entry_cancel_search (YelpLocationEntry *entry)
     event->window = gtk_widget_get_window (GTK_WIDGET (entry));
     event->send_event = FALSE;
     event->in = FALSE;
-    g_signal_emit_by_name (entry, "focus-out-event", 0, event);
+    g_signal_emit_by_name (entry, "focus-out-event", event, &ret);
     g_free (event);
     /* Hack: This makes the popup disappear when you hit Esc. */
     g_object_ref (priv->completion);
diff --git a/libyelp/yelp-view.c b/libyelp/yelp-view.c
index f6f539b..bb93190 100644
--- a/libyelp/yelp-view.c
+++ b/libyelp/yelp-view.c
@@ -474,11 +474,11 @@ yelp_view_load_uri (YelpView *view,
     priv->page_title = NULL;
     priv->page_desc = NULL;
     priv->page_icon = NULL;
-    g_signal_emit_by_name (view, "notify::page-id", 0);
-    g_signal_emit_by_name (view, "notify::root-title", 0);
-    g_signal_emit_by_name (view, "notify::page-title", 0);
-    g_signal_emit_by_name (view, "notify::page-desc", 0);
-    g_signal_emit_by_name (view, "notify::page-icon", 0);
+    g_signal_emit_by_name (view, "notify::page-id");
+    g_signal_emit_by_name (view, "notify::root-title");
+    g_signal_emit_by_name (view, "notify::page-title");
+    g_signal_emit_by_name (view, "notify::page-desc");
+    g_signal_emit_by_name (view, "notify::page-icon");
 
     gtk_action_set_sensitive (gtk_action_group_get_action (priv->action_group,
                                                            "YelpViewGoPrevious"),
@@ -860,7 +860,7 @@ uri_resolved (YelpUri  *uri,
 
     switch (yelp_uri_get_document_type (uri)) {
     case YELP_URI_DOCUMENT_TYPE_EXTERNAL:
-        g_signal_emit (view, signals[EXTERNAL_URI], 0, uri, 0);
+        g_signal_emit (view, signals[EXTERNAL_URI], 0, uri);
         return;
     case YELP_URI_DOCUMENT_TYPE_NOT_FOUND:
         struri = yelp_uri_get_canonical_uri (uri);
@@ -955,11 +955,11 @@ uri_resolved (YelpUri  *uri,
             gtk_widget_set_tooltip_text (GTK_WIDGET (cur->data), "");
     }
 
-    g_signal_emit_by_name (view, "notify::yelp-uri", 0);
+    g_signal_emit_by_name (view, "notify::yelp-uri");
 
     g_free (priv->page_id);
     priv->page_id = yelp_uri_get_page_id (priv->uri);
-    g_signal_emit_by_name (view, "notify::page-id", 0);
+    g_signal_emit_by_name (view, "notify::page-id");
 
     view_load_page (view);
 }
@@ -986,7 +986,7 @@ document_callback (YelpDocument       *document,
         else {
             g_free (priv->page_id);
             priv->page_id = real_id;
-            g_signal_emit_by_name (view, "notify::page-id", 0);
+            g_signal_emit_by_name (view, "notify::page-id");
         }
 
         g_free (priv->root_title);
@@ -1018,10 +1018,10 @@ document_callback (YelpDocument       *document,
         gtk_action_set_sensitive (action, next_id != NULL);
         g_free (next_id);
 
-        g_signal_emit_by_name (view, "notify::root-title", 0);
-        g_signal_emit_by_name (view, "notify::page-title", 0);
-        g_signal_emit_by_name (view, "notify::page-desc", 0);
-        g_signal_emit_by_name (view, "notify::page-icon", 0);
+        g_signal_emit_by_name (view, "notify::root-title");
+        g_signal_emit_by_name (view, "notify::page-title");
+        g_signal_emit_by_name (view, "notify::page-desc");
+        g_signal_emit_by_name (view, "notify::page-icon");
     }
     else if (signal == YELP_DOCUMENT_SIGNAL_CONTENTS) {
 	const gchar *contents;
diff --git a/src/yelp-application.c b/src/yelp-application.c
index 98b636a..b34a88c 100644
--- a/src/yelp-application.c
+++ b/src/yelp-application.c
@@ -596,7 +596,7 @@ yelp_application_add_bookmark (YelpApplication   *app,
             value = g_variant_builder_end (&builder);
             g_settings_set_value (settings, "bookmarks", value);
             g_variant_unref (value);
-            g_signal_emit (app, signals[BOOKMARKS_CHANGED], 0, doc_uri, 0);
+            g_signal_emit (app, signals[BOOKMARKS_CHANGED], 0, doc_uri);
         }
     }
 }



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