Re: schema default value and locale values



Whoops - the locale value passed to the GConf public API's is
a colon-separated path, so this is a doc bug, nothing more.

>From: Colm Smyth <colms ireland sun com>
>Subject: schema default value and locale values
>To: gconf-list gnome org
>Mime-Version: 1.0
>Content-MD5: wqs7m+R+GsTNrU+c0DJIbw==
>
>Hi,
>
>One thing that isn't clear to me from the documentation
>is the handling of the schema default value relative to
>locale values.
>
>The documentation for the query_value() function of the backend
>says:
>
>"This method must be implemented if the source is readable. It returns
>the value of a key. The "locales" argument is a NULL-terminated vector
>of locale names, where the first locale in the vector is the preferred
>locale, the next is the second choice, etc. if the "schema_name"
>argument is non-NULL, then it should be filled with an allocated string
>giving the name of the schema attached to the key, if and only if NULL
>is returned. This is an optimization to avoid looking up the same key
>again in the database if it's unset and we need to ask for its default
>value from the schema. If NULL is returned, indicating that the key is
>unset, then schema_name should not be filled in. If this method sets an
>error, NULL must be returned. It may not set an error while also
>returning a value. The returned value will be destroyed by the caller,
>so should be a copy of the backend's internal data."
>
>I assume that the sentence "If NULL is returned, indicating that the key 
is
>unset, then schema_name should not be filled in" means that if NULL
>is returned, the schema-name is also NULL because neither a value nor
>a schema were found.
>
>Also, the sources and backend API's allow multiple locales to be
>checked simultaneously, but the public API's only allow a single
>locale to be checked.
>
>I suggest:
>
>- a new API be provided in GNOME 2.0 to allow a GConf client to set the
>  list of locales that will be passed by GConf to the -sources and
>  -backend API's
>
>- that the precedence of locales and schemas be defined as:
>   1. search the locales for a value
>   2. search the schema for each locale for a value
>
>Colm.
>

--
Colm Smyth - Sun Microsystems, Ireland - Desktop S/W Engineering
Sun Xtn: 19166    Phone: 353-1-819-9166   Fax: 353-1-819-9200





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