aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-location-controller.c
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-02-29 00:39:45 +0800
committerXan Lopez <xan@igalia.com>2012-03-07 04:49:44 +0800
commit8ad6302a3f9e1a867f3dd61605196d22e9bd2f86 (patch)
tree0e5167f79659daa565fe455ae3c0a80f95e057ae /src/ephy-location-controller.c
parent306fb5a64f9b347fde9cf99ee7a594f04e9d7601 (diff)
downloadgsoc2013-epiphany-8ad6302a3f9e1a867f3dd61605196d22e9bd2f86.tar
gsoc2013-epiphany-8ad6302a3f9e1a867f3dd61605196d22e9bd2f86.tar.gz
gsoc2013-epiphany-8ad6302a3f9e1a867f3dd61605196d22e9bd2f86.tar.bz2
gsoc2013-epiphany-8ad6302a3f9e1a867f3dd61605196d22e9bd2f86.tar.lz
gsoc2013-epiphany-8ad6302a3f9e1a867f3dd61605196d22e9bd2f86.tar.xz
gsoc2013-epiphany-8ad6302a3f9e1a867f3dd61605196d22e9bd2f86.tar.zst
gsoc2013-epiphany-8ad6302a3f9e1a867f3dd61605196d22e9bd2f86.zip
Hook the new history to the URL entry
We now fetch the history from the SQL backend using a service thread, and merge the results with our old bookmark data.
Diffstat (limited to 'src/ephy-location-controller.c')
-rw-r--r--src/ephy-location-controller.c57
1 files changed, 11 insertions, 46 deletions
diff --git a/src/ephy-location-controller.c b/src/ephy-location-controller.c
index b0509ddaf..9315ad6cf 100644
--- a/src/ephy-location-controller.c
+++ b/src/ephy-location-controller.c
@@ -96,51 +96,8 @@ match_func (GtkEntryCompletion *completion,
GtkTreeIter *iter,
gpointer data)
{
- char *item = NULL;
- char *url = NULL;
- char *keywords = NULL;
-
- gboolean ret = FALSE;
- GtkTreeModel *model;
- GSList *search_terms;
-
- model = gtk_entry_completion_get_model (completion);
-
- gtk_tree_model_get (model, iter,
- EPHY_COMPLETION_TEXT_COL, &item,
- EPHY_COMPLETION_URL_COL, &url,
- EPHY_COMPLETION_KEYWORDS_COL, &keywords,
- -1);
-
- if (!key)
- return FALSE;
-
- search_terms = ephy_location_entry_get_search_terms (data);
-
- if (search_terms)
- {
- GSList *iter;
- GRegex *current = NULL;
-
- ret = TRUE;
- for (iter = search_terms; iter != NULL; iter = iter->next)
- {
- current = (GRegex*) iter->data;
- if ((!g_regex_match (current, item, G_REGEX_MATCH_NOTEMPTY, NULL)) &&
- (!g_regex_match (current, url, G_REGEX_MATCH_NOTEMPTY, NULL)) &&
- (!g_regex_match (current, keywords, G_REGEX_MATCH_NOTEMPTY, NULL)))
- {
- ret = FALSE;
- break;
- }
- }
- }
-
- g_free (item);
- g_free (url);
- g_free (keywords);
-
- return ret;
+ /* We want every row in the model to show up. */
+ return TRUE;
}
static void
@@ -211,6 +168,8 @@ static void
user_changed_cb (GtkWidget *widget, EphyLocationController *controller)
{
const char *address;
+ GtkTreeModel *model;
+ GtkEntryCompletion *completion;
address = ephy_location_entry_get_location (EPHY_LOCATION_ENTRY (widget));
@@ -218,6 +177,12 @@ user_changed_cb (GtkWidget *widget, EphyLocationController *controller)
g_signal_handlers_block_by_func (controller, G_CALLBACK (sync_address), widget);
ephy_location_controller_set_address (controller, address);
+
+ completion = gtk_entry_get_completion (GTK_ENTRY (widget));
+ model = gtk_entry_completion_get_model (completion);
+
+ ephy_completion_model_update_for_string (EPHY_COMPLETION_MODEL (model), address,
+ NULL, NULL);
g_signal_handlers_unblock_by_func (controller, G_CALLBACK (sync_address), widget);
}
@@ -428,7 +393,7 @@ ephy_location_controller_constructed (GObject *object)
EPHY_COMPLETION_EXTRA_COL,
EPHY_COMPLETION_FAVICON_COL);
g_object_unref (model);
-
+
ephy_location_entry_set_match_func (priv->location_entry,
match_func,
priv->location_entry,