Re: help with gconf basics



On Thu, Dec 26, 2002 at 01:53:32PM -0800, Steven Jenkins wrote:
> 	    <key>/apps/tidal/adc/device</key>
> 	    <applyto>/apps/tidal/adc/device</applyto>

You can't use the same key to store the schema, and to store your
config value. The schema is a separate object.

Read over http://www.gnome.org/projects/gconf/, and also the
newly-released gconf admin guide, both may help clarify this issue.

You want to store the schema somewhere else, conventionally
/schemas/apps/tidal/adc/device, and apply it to your key,
/apps/tidal/adc/device.
 
> When I run it on a valid (string-valued) key, I get a type mismatch:
> 
> $ ./test /apps/tidal/adc/device
> key /apps/tidal/adc/device
> error: Type mismatch:
>  Expected string, got schema

Because you stored the schema at /apps/tidal/adc/device

> When I run it on an invalid key, it dumps core:
> $ ./test /apps/tidal/adc/devicex
> ./cmds: line 1: 11268 Segmentation fault      ./test /apps/tidal/adc/devicex
> 

Because no error occurred, but you are trying to use "err->message"

"No value set" returns NULL, but is not an error.

> Program received signal SIGSEGV, Segmentation fault.
> 0x08048785 in main (argc=2, argv=0xbffffa04) at test.c:30
> 30		printf("error: %s\n", err->message);
> (gdb) print err
> $1 = (GError *) 0x0
> (gdb) quit

Yup.

Re: GConfClient vs. GConfEngine, GConfClient is just higher-level and
smarter. In GConf 2, GConfClient has no GTK dependency.

The smarts probably don't matter so much if you aren't doing change
notification, though GConfClient may still give you faster startup
time, if you add_directory with PRELOAD_ONELEVEL or PRELOAD_RECURSIVE
to minimize round trips.

Havoc




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