Re: Outstanding patches, #58609



"Matthias Clasen" <matthiasc poet de> writes:

> Ok, here is the last one before I go to bed:
> 
> The property editor which is popped up when clicking on the column titles
> doesn't work, since get_param_specs is nonfunctional.
> I looked through glib/gobject.h and found g_object_class_list_properties
> which seems to be just what is needed to fix this function.
> 
> Is this the right fix ? Ok to commit ?

This has two problems:

 - g_object_class_list_properties() returns allocated memory.

 - g_object_class_list_properties() lists all the properties
   for the class and its parents, not just the ones you 
   want.

   What you need to do is in create_prop_editor() when type == 0:
   create all the pages in the notebook, call 
   g_object_class_list_properties(), sort the results by name,
   and then iterate through them adding them to the appropriate
   page based on param_spec->owner_type. 
 
   For type != 0, you want to just find the properties
   where param_spec->owner_type == type.

Regards,
                                        Owen
 
> Index: tests/prop-editor.c
> ===================================================================
> RCS file: /cvs/gnome/gtk+/tests/prop-editor.c,v
> retrieving revision 1.5
> diff -u -3 -p -u -r1.5 prop-editor.c
> --- tests/prop-editor.c	2001/06/28 17:12:40	1.5
> +++ tests/prop-editor.c	2001/08/06 11:33:47
> @@ -30,13 +30,7 @@ get_param_specs (GType         type,
>  {
>    GObjectClass *class = g_type_class_peek (type);
>  
> -  /* We count on the fact we have an instance, or else we'd have
> -   * to use g_type_class_ref ();
> -   */
> -
> -  /* Use private interface for now, fix later */
> -  *specs = NULL; /* class->property_specs; */
> -  *n_specs = 0; /* class->n_property_specs; */
> +  *specs = g_object_class_list_properties (class, n_specs);
>  }
>  
>  typedef struct




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