GtkListStore Bug?



I'm looking at gtkliststore.c source because i want to write an BBDD
based List Store, and i found :

 static void 
 gtk_list_store_set_n_columns(GtkListStore *list_store,
			      gint ncolumns)
 {
    GType *new_columns;
    
    if (list_store->n_columns == n_columns) return;
    new_columns = g_new0(GType,n_columns);
    if (list_store->column_headers)
    {
       /* copy the old headers orders over */
       if (n_columns, list_store->n_columns)
memcpy(new_columns,list_store->column_headers,list_store->n_columns
*sizeof(gchar *));
       else

memcpy(new_columns,list_store->column_headers,n_columns*sizeof(GType));
       gfree(list_store->column_headers); 
    }
    if (list_store->sort_list)
	_gtk_tree_data_list_header_free(list_store->sort_list);

list_store->sort_list=_gtk_tree_data_list_header_new(n_columns,list_store->column_headers);
	list_store->column_headers=new_columns;
        list_store->n_columns = n_columns;
  }

¿The line
memcpy(new_columns,list_store->column_headers,list_store->n_columns
*sizeof(gchar *)); could not be
memcpy(new_columns,list_store->column_headers,list_store->n_columns
*sizeof(GType));?

And
¿The line
list_store->sort_list=_gtk_tree_data_list_header_new(n_columns,list_store->column_headers);
it not must be placed before list_store->column_headers=new_columns?

Sorry for my English...



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