aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ephy-autocompletion.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-06-19 02:06:02 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-06-19 02:06:02 +0800
commitb40f531dea45d3b365bd310536afddc32573caad (patch)
tree25e2c51d81a54558ad18494a935d2eacf6cd4b3f /lib/ephy-autocompletion.c
parentbabb935ba03b3888164c609b9d6c498f392dd2c0 (diff)
downloadgsoc2013-epiphany-b40f531dea45d3b365bd310536afddc32573caad.tar
gsoc2013-epiphany-b40f531dea45d3b365bd310536afddc32573caad.tar.gz
gsoc2013-epiphany-b40f531dea45d3b365bd310536afddc32573caad.tar.bz2
gsoc2013-epiphany-b40f531dea45d3b365bd310536afddc32573caad.tar.lz
gsoc2013-epiphany-b40f531dea45d3b365bd310536afddc32573caad.tar.xz
gsoc2013-epiphany-b40f531dea45d3b365bd310536afddc32573caad.tar.zst
gsoc2013-epiphany-b40f531dea45d3b365bd310536afddc32573caad.zip
Use insert_text delete_text to show/hide the autocompletion window.
2003-06-18 Marco Pesenti Gritti <marco@it.gnome.org> * lib/ephy-autocompletion.c: (ephy_autocompletion_refine_matches), (ephy_autocompletion_update_matches_full_item): * lib/widgets/ephy-location-entry.c: (ephy_location_entry_build), (ephy_location_entry_autocompletion_show_alternatives_to), (real_entry_set_location), (delete_text_cb), (insert_text_cb), (ephy_location_entry_key_press_event_cb), (ephy_location_entry_content_is_text), (ephy_location_entry_activate_cb): * src/bookmarks/ephy-bookmarks.c: (ephy_bookmarks_autocompletion_source_foreach): * src/ephy-location-action.c: (create_tool_item), (location_url_activate_cb): Use insert_text delete_text to show/hide the autocompletion window. Remember last search with autocompletion smart bookmarks.
Diffstat (limited to 'lib/ephy-autocompletion.c')
-rw-r--r--lib/ephy-autocompletion.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/lib/ephy-autocompletion.c b/lib/ephy-autocompletion.c
index e8fefdf4a..6744512b4 100644
--- a/lib/ephy-autocompletion.c
+++ b/lib/ephy-autocompletion.c
@@ -293,8 +293,8 @@ ephy_autocompletion_refine_matches (EphyAutocompletion *ac)
EphyAutocompletionMatch *mi = &oldmatches.array[i];
if (mi->is_action ||
- (mi->substring && g_strrstr (mi->match, p->keys[0])) ||
- (mi->substring && g_strrstr (mi->title, p->keys[0])) ||
+ (mi->match && mi->substring && g_strrstr (mi->match, p->keys[0])) ||
+ (mi->title && mi->substring && g_strrstr (mi->title, p->keys[0])) ||
!strncmp (key0, mi->title + mi->offset, key0l))
{
acma_append (&newmatches, mi, mi->is_action);
@@ -341,11 +341,23 @@ ephy_autocompletion_update_matches_full_item (EphyAutocompletionSource *source,
guint32 score,
EphyAutocompletionPrivate *p)
{
- g_return_if_fail ((item != NULL) || is_action);
-
- if (is_action ||
- (substring && g_strrstr (item, p->keys[0])) ||
- (substring && g_strrstr (title, p->keys[0])))
+ if (substring)
+ {
+ if ((item && g_strrstr (item, p->keys[0])) ||
+ (title && g_strrstr (title, p->keys[0])))
+ {
+ EphyAutocompletionMatch m;
+ m.match = item;
+ m.title = title;
+ m.target = target;
+ m.is_action = is_action;
+ m.substring = substring;
+ m.offset = 0;
+ m.score = score;
+ acma_append (&p->matches, &m, is_action);
+ }
+ }
+ else if (is_action)
{
EphyAutocompletionMatch m;
m.match = item;