From 0b39aeca159fdd8126cb7423dbe8753bf1b5c1e7 Mon Sep 17 00:00:00 2001 From: Diego Escalante Urrelo Date: Wed, 26 Dec 2007 18:38:42 +0000 Subject: Have the completion func also check the bookmark URLs for matches as it does with history items. Fixes bug #505683. svn path=/trunk/; revision=7827 --- src/ephy-location-action.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/ephy-location-action.c') diff --git a/src/ephy-location-action.c b/src/ephy-location-action.c index b244389fa..3d7ef7838 100644 --- a/src/ephy-location-action.c +++ b/src/ephy-location-action.c @@ -150,8 +150,8 @@ completion_func (GtkEntryCompletion *completion, { int i, len_key, len_prefix; char *item = NULL; - char *keywords = NULL; char *url = NULL; + char *keywords = NULL; gboolean ret = FALSE; GtkTreeModel *model; GtkTreeIter iter2; @@ -163,8 +163,8 @@ completion_func (GtkEntryCompletion *completion, gtk_tree_model_get (model, iter, EPHY_COMPLETION_TEXT_COL, &item, - EPHY_COMPLETION_KEYWORDS_COL, &keywords, EPHY_COMPLETION_URL_COL, &url, + EPHY_COMPLETION_KEYWORDS_COL, &keywords, -1); len_key = strlen (key); @@ -176,6 +176,10 @@ completion_func (GtkEntryCompletion *completion, { ret = TRUE; } + else if (!strncasecmp (key, url, len_key)) + { + ret = TRUE; + } else { for (i = 0; i < G_N_ELEMENTS (web_prefixes); i++) @@ -187,6 +191,13 @@ completion_func (GtkEntryCompletion *completion, ret = TRUE; break; } + else if (!strncmp (web_prefixes[i].prefix, url, len_prefix) && + !strncasecmp (key, url + len_prefix, len_key)) + { + ret = TRUE; + break; + } + } } @@ -206,8 +217,8 @@ completion_func (GtkEntryCompletion *completion, ret = FALSE; g_free (item); - g_free (keywords); g_free (url); + g_free (keywords); return ret; } -- cgit v1.2.3