problem with gconf_client_get_default_from_schema



Hello

I have defaults values in my schema, and I'm sure that
gconf knows them. But when I use gconf_client_get_default_from_schema
the returned value is alway NULL.
My code is:

// Set defaults values for parameters in a notebook page
void conf_set_defaults(int page)
{
  int n;
  ConfParam *param;
  GConfValue *default_value;

  for(n=0, param=params_table; n<params_table_size; n++, param++) {
    if(page==0 || page==param->notebook_page) {
      default_value=gconf_client_get_default_from_schema(gconf_client, param->key, NULL);
      if(default_value) {
        gconf_client_set(gconf_client, param->key, default_value, NULL);
        gconf_value_free(default_value);
      } else {
        gconf_client_unset(gconf_client, param->key, NULL);
      }
    }
  }
}

where *param is a structure containing all informations about a parameter.
In this code, default_value is always NULL, so all parameters are unset,
and then when I close the program and run it again values are the
defaults one.

I know that I can unset and then get the value to have the default, but
I would like to know if gconf_client_get_default_from_schema works.

Thanks for this great program.



-- 
Emmanuel Chantréau (Montpellier France) http://www.maretmanu.org/homepage/
Je vous vois scié, mais je suis sis céans car il me sied d'asseoir mon séant.





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