[Xfce4-commits] r30225 - in xfce4-appfinder/trunk: . src

Colin Leroy colin at xfce.org
Thu Jul 9 08:46:18 CEST 2009


On Thu, 9 Jul 2009 08:25:01 +0200, Nick Schermer wrote:

Hi,

> > +      categories_array = g_new0 (const gchar *, g_list_length
> > (categories) + 1); +
> > +      for (lp = categories, n = 0; lp != NULL; lp = lp->next, ++n)
> > +        categories_array[n] = lp->data;

gchar *tmp = NULL, *categories_string = NULL;

for (lp = categories; lp != NULL; lp = lp->next) 
  {
    tmp = g_strdup_printf("%s%s%s", 
             categories_string ? categories_string : "",
             categories_string ? ", " : "",
             lp->data);
    g_free(categories_string);
    categories_string = tmp;
  }

(Yeah, I feel like coding these days :)
-- 
Colin



More information about the Xfce4-dev mailing list