[recipes] Remove leading and trailing spaces from unit_entry



commit 7005d7c3958843a842a58b832112aecef51bdabb
Author: Ekta Nandwani <mailnandwaniekta gmail com>
Date:   Wed Apr 26 01:38:45 2017 +0530

    Remove leading and trailing spaces from  unit_entry
    
    This allows the unit_entry to split in amount and unit by removing spaces

 src/gr-ingredients-viewer-row.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/gr-ingredients-viewer-row.c b/src/gr-ingredients-viewer-row.c
index 9cbcf00..4631a1c 100644
--- a/src/gr-ingredients-viewer-row.c
+++ b/src/gr-ingredients-viewer-row.c
@@ -262,7 +262,8 @@ edit_ingredient (GrIngredientsViewerRow *row)
 static void
 save_row (GrIngredientsViewerRow *row)
 {
-        char** strv = g_strsplit (gtk_entry_get_text (GTK_ENTRY (row->unit_entry)), " ", -1);
+        g_autofree char *tmp = g_strstrip (g_strdup (gtk_entry_get_text (GTK_ENTRY (row->unit_entry))));
+        char** strv = g_strsplit (tmp, " ", -1);
 
         row->amount = strv[0];
         row->unit = strv[1];


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