diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ephy-start-here.c | 17 | ||||
-rw-r--r-- | lib/widgets/ephy-autocompletion-window.c | 2 | ||||
-rw-r--r-- | lib/widgets/ephy-location-entry.c | 14 |
3 files changed, 18 insertions, 15 deletions
diff --git a/lib/ephy-start-here.c b/lib/ephy-start-here.c index 3de8dffa3..834d890da 100644 --- a/lib/ephy-start-here.c +++ b/lib/ephy-start-here.c @@ -378,12 +378,11 @@ build_content (EphyStartHere *sh, xmlNodePtr node) char * ephy_start_here_get_page (EphyStartHere *sh, const char *id) { - xmlNodePtr child; - xmlNodePtr root; - xmlBufferPtr buf; + xmlNodePtr root; const char *xml_filepath; char *xml_filename; - char *content; + xmlChar *content; + int size; xml_filename = g_strconcat ("starthere/", id, ".xml", NULL); xml_filepath = ephy_file (xml_filename); @@ -392,20 +391,12 @@ ephy_start_here_get_page (EphyStartHere *sh, const char *id) sh->priv->doc = xmlParseFile (xml_filepath); root = xmlDocGetRootElement (sh->priv->doc); - buf = xmlBufferCreate (); select_language (sh, root); build_content (sh, root); - child = sh->priv->doc->children; - while (child) - { - xmlNodeDump (buf, sh->priv->doc, child, 1, 1); - child = child->next; - } + xmlDocDumpMemory (sh->priv->doc, &content, &size); - content = g_strdup (xmlBufferContent (buf)); - xmlBufferFree (buf); xmlFreeDoc (sh->priv->doc); return content; diff --git a/lib/widgets/ephy-autocompletion-window.c b/lib/widgets/ephy-autocompletion-window.c index 8921c93f1..e57735438 100644 --- a/lib/widgets/ephy-autocompletion-window.c +++ b/lib/widgets/ephy-autocompletion-window.c @@ -731,6 +731,8 @@ ephy_autocompletion_window_key_press_hack (EphyAutocompletionWindow *aw, break; } + action = (p->active_tree_view == p->action_tree_view); + switch (keyval) { case GDK_Up: diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c index e6fde2889..57fb89485 100644 --- a/lib/widgets/ephy-location-entry.c +++ b/lib/widgets/ephy-location-entry.c @@ -140,6 +140,7 @@ ephy_location_entry_init (EphyLocationEntry *w) w->priv = p; p->last_action_target = NULL; p->editing = FALSE; + p->before_completion = NULL; ephy_location_entry_build (w); @@ -169,6 +170,8 @@ ephy_location_entry_finalize_impl (GObject *o) LOG ("EphyLocationEntry finalized") + g_free (p->before_completion); + g_free (p); G_OBJECT_CLASS (gtk_hbox_class)->finalize (o); } @@ -245,6 +248,9 @@ ephy_location_entry_autocompletion_show_alternatives_to (EphyLocationEntry *w) { EphyLocationEntryPrivate *p = w->priv; + g_free (p->before_completion), + p->before_completion = gtk_editable_get_chars (GTK_EDITABLE(p->entry), 0, -1); + if (ephy_location_ignore_prefix (w)) return FALSE; if (p->autocompletion) @@ -378,11 +384,15 @@ ephy_location_entry_key_press_event_cb (GtkWidget *entry, GdkEventKey *event, Ep case GDK_Right: case GDK_Up: case GDK_Down: - case GDK_Escape: case GDK_Page_Up: case GDK_Page_Down: ephy_location_entry_autocompletion_hide_alternatives (w); return FALSE; + case GDK_Escape: + real_entry_set_location (w, p->before_completion); + gtk_editable_set_position (GTK_EDITABLE (p->entry), -1); + ephy_location_entry_autocompletion_hide_alternatives (w); + return FALSE; default: w->priv->editing = TRUE; ephy_location_entry_autocompletion_unselect_alternatives (w); @@ -468,7 +478,7 @@ ephy_location_entry_autocompletion_window_url_selected_cb (EphyAutocompletionWin int action, EphyLocationEntry *w) { - real_entry_set_location (w, target); + real_entry_set_location (w, action ? w->priv->before_completion : target); } void |