[epiphany] Update location entry address when title box mode changes



commit 27867c02a8e40794b3cda74290fb7ad5212e2305
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Sat Aug 30 20:21:37 2014 -0500

    Update location entry address when title box mode changes
    
    Otherwise, we get stuck displaying an old address if the page changes
    while the entry is locked.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=734952

 src/ephy-location-controller.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/ephy-location-controller.c b/src/ephy-location-controller.c
index 38773d8..a281b47 100644
--- a/src/ephy-location-controller.c
+++ b/src/ephy-location-controller.c
@@ -296,6 +296,17 @@ sync_address (EphyLocationController *controller,
        g_signal_handlers_unblock_by_func (widget, G_CALLBACK (user_changed_cb), controller);
 }
 
+static void
+title_box_mode_changed_cb (EphyTitleBox *title_box,
+                          GParamSpec *psec,
+                          gpointer user_data)
+{
+       EphyLocationController *controller = EPHY_LOCATION_CONTROLLER (user_data);
+       EphyLocationControllerPrivate *priv = controller->priv;
+
+       sync_address (controller, NULL, GTK_WIDGET (priv->location_entry));
+}
+
 static char *
 get_location_cb (EphyLocationEntry *entry,
                EphyLocationController *controller)
@@ -450,6 +461,9 @@ ephy_location_controller_constructed (GObject *object)
 
        add_completion_actions (controller, priv->location_entry);
 
+       g_signal_connect_object (priv->title_box, "notify::mode",
+                                G_CALLBACK (title_box_mode_changed_cb), controller, 0);
+
        sync_address (controller, NULL, widget);
        g_signal_connect_object (controller, "notify::address",
                                 G_CALLBACK (sync_address), widget, 0);
@@ -572,6 +586,8 @@ ephy_location_controller_dispose (GObject *object)
                                              0, 0, NULL, NULL, priv->location_entry);
        g_signal_handlers_disconnect_matched (priv->location_entry, G_SIGNAL_MATCH_DATA,
                                              0, 0, NULL, NULL, controller);
+       g_signal_handlers_disconnect_matched (priv->title_box, G_SIGNAL_MATCH_DATA,
+                                             0, 0, NULL, NULL, controller);
        g_signal_handlers_disconnect_matched (notebook, G_SIGNAL_MATCH_DATA,
                                              0, 0, NULL, NULL, controller);
        priv->location_entry = NULL;


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