Mercurial > pidgin.yaz
changeset 21699:760a8e024142
Emit the 'completion' signal when tab is pressed from a suggest word.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Fri, 30 Nov 2007 22:36:33 +0000 |
parents | 1d13939502cd |
children | a4237a2117ab |
files | finch/libgnt/gntentry.c |
diffstat | 1 files changed, 3 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/finch/libgnt/gntentry.c Fri Nov 30 19:02:20 2007 +0000 +++ b/finch/libgnt/gntentry.c Fri Nov 30 22:36:33 2007 +0000 @@ -140,7 +140,6 @@ static gboolean complete_suggest(GntEntry *entry, const char *text) { - gboolean changed = FALSE; int offstart = 0, offend = 0; if (entry->word) { @@ -148,27 +147,22 @@ const char *iter = text; offstart = g_utf8_pointer_to_offset(entry->start, s); while (*iter && toupper(*s) == toupper(*iter)) { - if (*s != *iter) - changed = TRUE; *s++ = *iter++; } if (*iter) { gnt_entry_key_pressed(GNT_WIDGET(entry), iter); - changed = TRUE; } offend = g_utf8_pointer_to_offset(entry->start, entry->cursor); } else { offstart = 0; gnt_entry_set_text_internal(entry, text); - changed = TRUE; offend = g_utf8_strlen(text, -1); } - if (changed) - g_signal_emit(G_OBJECT(entry), signals[SIG_COMPLETION], 0, - entry->start + offstart, entry->start + offend); + g_signal_emit(G_OBJECT(entry), signals[SIG_COMPLETION], 0, + entry->start + offstart, entry->start + offend); update_kill_ring(entry, ENTRY_JAIL, NULL, 0); - return changed; + return TRUE; } static int