Clear pending completions thoroughly

Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19828
This commit is contained in:
Federico Mena Quintero 2008-03-13 00:38:31 +00:00 committed by Federico Mena Quintero
parent e7009432b2
commit 11a9457ee1

View File

@ -594,6 +594,13 @@ gtk_file_chooser_entry_do_insert_text (GtkEditable *editable,
install_start_autocompletion_idle (chooser_entry);
}
static void
clear_completions (GtkFileChooserEntry *chooser_entry)
{
chooser_entry->has_completion = FALSE;
chooser_entry->load_complete_action = LOAD_COMPLETE_NOTHING;
}
static void
gtk_file_chooser_entry_do_delete_text (GtkEditable *editable,
gint start_pos,
@ -606,7 +613,7 @@ gtk_file_chooser_entry_do_delete_text (GtkEditable *editable,
if (chooser_entry->in_change)
return;
chooser_entry->load_complete_action = LOAD_COMPLETE_NOTHING;
clear_completions (chooser_entry);
}
static void
@ -620,7 +627,7 @@ gtk_file_chooser_entry_set_position (GtkEditable *editable,
if (chooser_entry->in_change)
return;
chooser_entry->load_complete_action = LOAD_COMPLETE_NOTHING;
clear_completions (chooser_entry);
}
static void
@ -635,7 +642,7 @@ gtk_file_chooser_entry_set_selection_bounds (GtkEditable *editable,
if (chooser_entry->in_change)
return;
chooser_entry->load_complete_action = LOAD_COMPLETE_NOTHING;
clear_completions (chooser_entry);
}
static void
@ -680,10 +687,13 @@ gtk_file_chooser_entry_focus (GtkWidget *widget,
if (chooser_entry->has_completion)
{
gboolean has_selection;
gint sel_end;
if (gtk_editable_get_selection_bounds (editable, NULL, &sel_end))
gtk_editable_set_position (editable, sel_end);
has_selection = gtk_editable_get_selection_bounds (editable, NULL, &sel_end);
g_assert (has_selection && sel_end == GTK_ENTRY (entry)->text_length);
gtk_editable_set_position (editable, sel_end);
}
else
{