« Return to Thread: Re: [Xfce4-commits] r30225 - in xfce4-appfinder/trunk: . src

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

by Colin Leroy-2 :: Rate this Message:

Reply to Author | View in Thread

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
_______________________________________________
Xfce4-dev mailing list
Xfce4-dev@...
http://foo-projects.org/mailman/listinfo/xfce4-dev

 « Return to Thread: Re: [Xfce4-commits] r30225 - in xfce4-appfinder/trunk: . src