aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ephy-autocompletion.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-02-26 08:59:17 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-02-26 08:59:17 +0800
commit2227b7a87f73bea0b61e92aa003d7a5a77c1a583 (patch)
treef58ff04b5234fae159b52a2976c6ab1b33121f85 /lib/ephy-autocompletion.c
parenta19a320b865685d726ed8a50b36872596ddd70be (diff)
downloadgsoc2013-epiphany-2227b7a87f73bea0b61e92aa003d7a5a77c1a583.tar
gsoc2013-epiphany-2227b7a87f73bea0b61e92aa003d7a5a77c1a583.tar.gz
gsoc2013-epiphany-2227b7a87f73bea0b61e92aa003d7a5a77c1a583.tar.bz2
gsoc2013-epiphany-2227b7a87f73bea0b61e92aa003d7a5a77c1a583.tar.lz
gsoc2013-epiphany-2227b7a87f73bea0b61e92aa003d7a5a77c1a583.tar.xz
gsoc2013-epiphany-2227b7a87f73bea0b61e92aa003d7a5a77c1a583.tar.zst
gsoc2013-epiphany-2227b7a87f73bea0b61e92aa003d7a5a77c1a583.zip
Remove Tab autocompletion. Behavior still not optimal, but that code is
2003-02-26 Marco Pesenti Gritti <marco@it.gnome.org> * lib/ephy-autocompletion.c: (ephy_autocompletion_init), (ephy_autocompletion_reset), (ephy_autocompletion_set_key), (ephy_autocompletion_update_matches): * lib/ephy-autocompletion.h: * lib/widgets/ephy-location-entry.c: (ephy_location_entry_key_press_event_cb), (ephy_location_entry_autocompletion_sources_changed_cb): Remove Tab autocompletion. Behavior still not optimal, but that code is such a pain :(
Diffstat (limited to 'lib/ephy-autocompletion.c')
-rw-r--r--lib/ephy-autocompletion.c60
1 files changed, 0 insertions, 60 deletions
diff --git a/lib/ephy-autocompletion.c b/lib/ephy-autocompletion.c
index 3fd67a5df..24578f126 100644
--- a/lib/ephy-autocompletion.c
+++ b/lib/ephy-autocompletion.c
@@ -52,7 +52,6 @@ struct _EphyAutocompletionPrivate {
gchar **prefixes;
guint *prefix_lengths;
- gchar *common_prefix;
ACMatchArray matches;
EphyAutocompletionStatus status;
gboolean sorted;
@@ -121,7 +120,6 @@ ephy_autocompletion_init (EphyAutocompletion *ac)
EphyAutocompletionPrivate *p = g_new0 (EphyAutocompletionPrivate, 1);
ac->priv = p;
p->sources = NULL;
- p->common_prefix = NULL;
acma_init (&p->matches);
p->status = GAS_NEEDS_FULL_UPDATE;
@@ -174,8 +172,6 @@ ephy_autocompletion_reset (EphyAutocompletion *ac)
START_PROFILER ("Resetting autocompletion")
- g_free (p->common_prefix);
- p->common_prefix = NULL;
p->status = GAS_NEEDS_FULL_UPDATE;
STOP_PROFILER ("Resetting autocompletion")
@@ -231,20 +227,10 @@ ephy_autocompletion_set_key (EphyAutocompletion *ac,
{
p->status = GAS_NEEDS_REFINE;
}
- if (p->common_prefix)
- {
- if (strncmp (p->common_prefix, key, keylen))
- {
- g_free (p->common_prefix);
- p->common_prefix = NULL;
- }
- }
}
else
{
p->status = GAS_NEEDS_FULL_UPDATE;
- g_free (p->common_prefix);
- p->common_prefix = NULL;
}
for (i = 0; p->prefixes[i]; ++i)
@@ -256,50 +242,6 @@ ephy_autocompletion_set_key (EphyAutocompletion *ac,
}
-gchar *
-ephy_autocompletion_get_common_prefix (EphyAutocompletion *ac)
-{
- EphyAutocompletionPrivate *p = ac->priv;
- ephy_autocompletion_update_matches (ac);
- if (!p->common_prefix)
- {
- guint common_length = 0;
- guint i;
-
- START_PROFILER ("Get Common Prefix")
-
- for (i = 0; i < p->matches.num_matches; i++)
- {
- EphyAutocompletionMatch *mi = &p->matches.array[i];
- const gchar *realmatch = mi->title + mi->offset;
- if (!p->common_prefix)
- {
- p->common_prefix = g_strdup (realmatch);
- common_length = strlen (p->common_prefix);
- continue;
- }
- else if (!strncmp (realmatch, p->common_prefix, common_length))
- {
- continue;
- }
- else
- {
- common_length = 0;
- while (realmatch[common_length]
- && realmatch[common_length] == p->common_prefix[common_length])
- {
- ++common_length;
- }
- g_free (p->common_prefix);
- p->common_prefix = g_strndup (realmatch, common_length);
- }
- }
-
- STOP_PROFILER ("Get Common Prefix")
- }
- return g_strdup (p->common_prefix);
-}
-
const EphyAutocompletionMatch *
ephy_autocompletion_get_matches (EphyAutocompletion *ac)
{
@@ -387,8 +329,6 @@ ephy_autocompletion_update_matches (EphyAutocompletion *ac)
ephy_autocompletion_refine_matches (ac);
}
- g_free (p->common_prefix);
- p->common_prefix = NULL;
p->status = GAS_UPDATED;
}