aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/addr_compl.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/addr_compl.c b/src/addr_compl.c
index 39433fb2..9735f273 100644
--- a/src/addr_compl.c
+++ b/src/addr_compl.c
@@ -296,16 +296,25 @@ gchar *get_address_from_edit(GtkEntry *entry, gint *start_pos)
void replace_address_in_edit(GtkEntry *entry, const gchar *newtext,
gint start_pos)
{
+ gchar *origtext;
+
if (!newtext) return;
+ g_print("replace_address_in_edit: %s\n", newtext);
+
+ origtext = gtk_editable_get_chars(GTK_EDITABLE(entry), start_pos, -1);
+ if (!strcmp(origtext, newtext)) {
+ g_free(origtext);
+ return;
+ }
+ g_free(origtext);
+
g_signal_handlers_block_by_func
(entry, address_completion_entry_changed, NULL);
-
gtk_editable_delete_text(GTK_EDITABLE(entry), start_pos, -1);
gtk_editable_insert_text(GTK_EDITABLE(entry), newtext, strlen(newtext),
&start_pos);
gtk_editable_set_position(GTK_EDITABLE(entry), -1);
-
g_signal_handlers_unblock_by_func
(entry, address_completion_entry_changed, NULL);
}