r20821 - in /desktop/unstable/epiphany-webkit/debian: changelog patches/16_reimplement_search_on_locationbar.patch patches/series
kov at users.alioth.debian.org
kov at users.alioth.debian.org
Thu Jul 30 15:17:24 UTC 2009
Author: kov
Date: Thu Jul 30 15:17:23 2009
New Revision: 20821
URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=20821
Log:
Patch to make searching on the location bar work again
Added:
desktop/unstable/epiphany-webkit/debian/patches/16_reimplement_search_on_locationbar.patch
Modified:
desktop/unstable/epiphany-webkit/debian/changelog
desktop/unstable/epiphany-webkit/debian/patches/series
Modified: desktop/unstable/epiphany-webkit/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/epiphany-webkit/debian/changelog?rev=20821&op=diff
==============================================================================
--- desktop/unstable/epiphany-webkit/debian/changelog [utf-8] (original)
+++ desktop/unstable/epiphany-webkit/debian/changelog [utf-8] Thu Jul 30 15:17:23 2009
@@ -1,8 +1,11 @@
epiphany-webkit (2.27.5-1) UNRELEASED; urgency=low
* New upstream release.
-
- -- Gustavo Noronha Silva <kov at debian.org> Wed, 24 Jun 2009 18:31:10 -0300
+ * debian/patches/16_reimplement_search_on_locationbar.patch:
+ - fetched from upstream bugzilla (see http://bugzilla.gnome.org/show_bug.cgi?id=583795)
+ (Closes: #538325)
+
+ -- Gustavo Noronha Silva <kov at debian.org> Thu, 30 Jul 2009 17:16:54 +0200
epiphany-webkit (2.27.3-1) unstable; urgency=low
Added: desktop/unstable/epiphany-webkit/debian/patches/16_reimplement_search_on_locationbar.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/epiphany-webkit/debian/patches/16_reimplement_search_on_locationbar.patch?rev=20821&op=file
==============================================================================
--- desktop/unstable/epiphany-webkit/debian/patches/16_reimplement_search_on_locationbar.patch (added)
+++ desktop/unstable/epiphany-webkit/debian/patches/16_reimplement_search_on_locationbar.patch [utf-8] Thu Jul 30 15:17:23 2009
@@ -1,0 +1,138 @@
+From 61438f2aa8b784b30d88414816174efa8f63bd0f Mon Sep 17 00:00:00 2001
+From: Michael Kuhn <suraia at ikkoku.de>
+Date: Thu, 30 Jul 2009 16:59:33 +0200
+Subject: [PATCH] Use the load-error signal to reimplement search on the location bar
+
+Changes slightly modified by Gustavo Noronha Silva to apply comments
+about also checking if the error is related to DNS (and the other
+error soup uses when we try to load multiple words as an URI).
+
+Bug #583795
+---
+ embed/ephy-embed.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
+ embed/ephy-embed.h | 5 +++--
+ src/ephy-link.c | 5 +++++
+ 3 files changed, 52 insertions(+), 2 deletions(-)
+
+diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
+index 18c943f..181a73c 100644
+--- a/embed/ephy-embed.c
++++ b/embed/ephy-embed.c
+@@ -62,6 +62,7 @@ struct EphyEmbedPrivate
+ EphyHistory *history;
+ GtkWidget *inspector_window;
+ guint is_setting_zoom : 1;
++ guint handle_load_error : 1;
+ };
+
+ static void
+@@ -224,6 +225,40 @@ load_status_changed_cb (WebKitWebView *view,
+ }
+ }
+
++static gboolean
++load_error_cb (WebKitWebView *web_view,
++ WebKitWebFrame *web_frame,
++ const char *uri,
++ GError *error,
++ EphyEmbed *embed)
++{
++ if (embed->priv->handle_load_error == TRUE &&
++ g_str_has_prefix (uri, "http://") == TRUE &&
++ (error->code == SOUP_STATUS_CANT_RESOLVE ||
++ error->code == SOUP_STATUS_SWITCHING_PROTOCOLS)) {
++ char *tmp_uri = g_strdup (uri);
++ char *effective_uri = NULL;
++
++ embed->priv->handle_load_error = FALSE;
++
++ /* Remove slash that is added to the URI when DNS fails.
++ * FIXME: who is adding this slash here? */
++ if (error->code == SOUP_STATUS_CANT_RESOLVE)
++ tmp_uri[strlen (tmp_uri) - 1] = '\0';
++
++ /* Search for uri without the http:// prefix. */
++ effective_uri = g_strdup_printf (_("http://www.google.com/search?q=%s&ie=UTF-8&oe=UTF-8"), tmp_uri + 7);
++
++ ephy_web_view_load_url (EPHY_WEB_VIEW (web_view), effective_uri);
++
++ g_free (tmp_uri);
++ g_free (effective_uri);
++
++ return TRUE;
++ } else
++ return FALSE;
++}
++
+ static void
+ hovering_over_link_cb (WebKitWebView *web_view,
+ char *title,
+@@ -674,6 +709,7 @@ ephy_embed_constructed (GObject *object)
+
+ g_object_connect (web_view,
+ "signal::notify::load-status", G_CALLBACK (load_status_changed_cb), embed,
++ "signal::load-error", G_CALLBACK (load_error_cb), embed,
+ "signal::hovering-over-link", G_CALLBACK (hovering_over_link_cb), embed,
+ "signal::mime-type-policy-decision-requested", G_CALLBACK (mime_type_policy_decision_requested_cb), embed,
+ "signal::download-requested", G_CALLBACK (download_requested_cb), embed,
+@@ -735,3 +771,11 @@ ephy_embed_get_web_view (EphyEmbed *embed)
+
+ return EPHY_WEB_VIEW (embed->priv->web_view);
+ }
++
++void
++ephy_embed_handle_load_error (EphyEmbed *embed)
++{
++ g_return_if_fail (EPHY_IS_EMBED (embed));
++
++ embed->priv->handle_load_error = TRUE;
++}
+diff --git a/embed/ephy-embed.h b/embed/ephy-embed.h
+index 18fb6ed..40387b4 100644
+--- a/embed/ephy-embed.h
++++ b/embed/ephy-embed.h
+@@ -51,8 +51,9 @@ struct EphyEmbedClass {
+ GtkScrolledWindowClass parent_class;
+ };
+
+-GType ephy_embed_get_type (void);
+-EphyWebView* ephy_embed_get_web_view (EphyEmbed *embed);
++GType ephy_embed_get_type (void);
++EphyWebView* ephy_embed_get_web_view (EphyEmbed *embed);
++void ephy_embed_handle_load_error (EphyEmbed *embed);
+
+ G_END_DECLS
+
+diff --git a/src/ephy-link.c b/src/ephy-link.c
+index 7845dfb..b4090f9 100644
+--- a/src/ephy-link.c
++++ b/src/ephy-link.c
+@@ -90,6 +90,7 @@ ephy_link_open (EphyLink *link,
+ {
+ EphyEmbed *new_embed = NULL;
+ char *effective_url = NULL;
++ gboolean handle_load_error = FALSE;
+
+ /*
+ * WebKit does not normalize URI's by itself, so we need to
+@@ -98,6 +99,7 @@ ephy_link_open (EphyLink *link,
+ if (ephy_embed_utils_address_has_web_scheme (address) == FALSE)
+ {
+ effective_url = g_strconcat ("http://", address, NULL);
++ handle_load_error = TRUE;
+ }
+ else
+ {
+@@ -112,6 +114,9 @@ ephy_link_open (EphyLink *link,
+
+ g_free (effective_url);
+
++ if (new_embed != NULL && handle_load_error == TRUE)
++ ephy_embed_handle_load_error(new_embed);
++
+ return new_embed;
+ }
+
+--
+1.6.3.3
+
Modified: desktop/unstable/epiphany-webkit/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/epiphany-webkit/debian/patches/series?rev=20821&op=diff
==============================================================================
--- desktop/unstable/epiphany-webkit/debian/patches/series [utf-8] (original)
+++ desktop/unstable/epiphany-webkit/debian/patches/series [utf-8] Thu Jul 30 15:17:23 2009
@@ -9,5 +9,6 @@
12_safetypes.patch
14_webkit_temporary_gconf_rename.patch
15_webkit_temporary_gettext_domain_rename.patch
+16_reimplement_search_on_locationbar.patch
99_autoreconf.patch
99_ltmain_as-needed.patch
More information about the pkg-gnome-commits
mailing list