From aaf35d0a5cb632c57fe84c5d41648168bc703fe4 Mon Sep 17 00:00:00 2001 From: "Alejandro G. Castro" Date: Tue, 4 May 2010 13:18:14 +0200 Subject: Handle the WEBKIT_NETWORK_ERROR_CANCELLED fail In this case the user cancelled the load, we set the address of the current page loaded in the webview again in order to avoid showing an URL that was not committed. --- embed/ephy-web-view.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'embed') diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index 669ffd6e6..a0c63c7f9 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -2119,8 +2119,9 @@ load_error_cb (WebKitWebView *web_view, GError *error, gpointer user_data) { + EphyWebView *view = EPHY_WEB_VIEW (web_view); + if (error->code != WEBKIT_NETWORK_ERROR_CANCELLED) { - EphyWebView *view = EPHY_WEB_VIEW (web_view); gchar *message; message = g_strdup_printf (_("A problem occurred while loading %s"), @@ -2129,6 +2130,13 @@ load_error_cb (WebKitWebView *web_view, g_free (message); _ephy_web_view_set_icon_address (view, NULL); + } else { + const gchar* uri; + + uri = webkit_web_view_get_uri (web_view); + + ephy_web_view_set_typed_address (view, NULL); + ephy_web_view_set_address (view, uri); } return FALSE; -- cgit v1.2.3