soylent r261 - trunk/libsoylent/example



Author: svenp
Date: Fri Aug  1 10:22:30 2008
New Revision: 261
URL: http://svn.gnome.org/viewvc/soylent?rev=261&view=rev

Log:
example now uses to_string functionality

Modified:
   trunk/libsoylent/example/example-list.c

Modified: trunk/libsoylent/example/example-list.c
==============================================================================
--- trunk/libsoylent/example/example-list.c	(original)
+++ trunk/libsoylent/example/example-list.c	Fri Aug  1 10:22:30 2008
@@ -58,7 +58,8 @@
           
           /* print attribute name */
           SlAttribute *attr = attributes->data;
-          g_print (" * %s\n", sl_attribute_get_name (attr));
+          const gchar *attrname = sl_attribute_get_name (attr);
+          g_print (" * %s\n", attrname);
           
           /* iterate through all values of Âattr */
           GList *values = sl_attribute_get_all (attr);
@@ -68,7 +69,9 @@
             {
               
               /* print the value (along with the index) */
-              g_print ("   * [%d] %s\n", i, (gchar *) values->data);
+              gchar *str = sl_attribute_to_string (attrname, values->data);
+              g_print ("   * [%d] %s\n", i, str);
+              g_free (str);
               values = values->next;
             }
         }



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