[nautilus] batch-rename-dialog: use strlen for gtk_editable_insert_text
- From: Carlos Soriano <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] batch-rename-dialog: use strlen for gtk_editable_insert_text
- Date: Tue, 27 Sep 2016 14:47:43 +0000 (UTC)
commit 69b9d0b83344017a168833810d360b76e83e98f7
Author: Carlos Soriano <csoriano gnome org>
Date: Tue Sep 27 16:42:37 2016 +0200
batch-rename-dialog: use strlen for gtk_editable_insert_text
We were using utf8_lenght, which is the right approach to know the
number of characters. However, gtk_editable_insert_text expects bytes
rather than number of characters.
This was causing languages that have unicode characters in the tags
to have a buggy batch rename dialog.
To fix it, use strlen so we get the number of bytes.
https://bugzilla.gnome.org/show_bug.cgi?id=772063
src/nautilus-batch-rename-dialog.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/nautilus-batch-rename-dialog.c b/src/nautilus-batch-rename-dialog.c
index aa32be4..4e941e2 100644
--- a/src/nautilus-batch-rename-dialog.c
+++ b/src/nautilus-batch-rename-dialog.c
@@ -196,7 +196,7 @@ add_tag (NautilusBatchRenameDialog *self,
*/
gtk_editable_insert_text (GTK_EDITABLE (self->name_entry),
tag_text_representation,
- g_utf8_strlen (tag_text_representation, -1),
+ strlen (tag_text_representation),
&cursor_position);
tag_data->just_added = FALSE;
gtk_editable_set_position (GTK_EDITABLE (self->name_entry), cursor_position);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]