[gthumb] strip the tags when setting the list from a text value



commit 5a03d2cde0322bfb817f4a1921850c39bde18fd4
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Tue Mar 6 15:08:47 2012 +0100

    strip the tags when setting the list from a text value

 gthumb/gth-tags-entry.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gthumb/gth-tags-entry.c b/gthumb/gth-tags-entry.c
index 10a4f53..9861b11 100644
--- a/gthumb/gth-tags-entry.c
+++ b/gthumb/gth-tags-entry.c
@@ -886,6 +886,7 @@ gth_tags_entry_set_tags_from_text (GthTagsEntry *self,
 				   const char   *text)
 {
 	char **tags;
+	int    i;
 
 	if ((text == NULL) || (strcmp (text, "") == 0)) {
 		gth_tags_entry_set_tags (self, NULL);
@@ -893,6 +894,8 @@ gth_tags_entry_set_tags_from_text (GthTagsEntry *self,
 	}
 
 	tags = g_strsplit (text, ",", -1);
+	for (i = 0; tags[i] != NULL; i++)
+		tags[i] = g_strstrip (tags[i]);
 	gth_tags_entry_set_tags (self, tags);
 
 	g_strfreev (tags);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]