Re: [gnome-love] need help with GConf in a program



Hi Kim. I looked through you code and here are my suggestions:

in main:

/* Only monitor your directory and not all of /apps. Also this is only needed
when you want to ne notified of changes to gconf values*/
gconf_client_add_dir(client, "/apps/gnetchange", GCONF_CLIENT_PRELOAD_NONE, NULL);

/* Notice you use /apps/multinet/ by mistake ;) */
gconf_client_set_string (client, "/apps/gnetchange/test", "test", NULL);

So at this point gconf should set the test string properly. In other words calling gconf_client_get_string 
(client,"/apps/gnetchange/test", NULL) should return
"test". 


Now in signals.c you use the GConfClient *client, but I am assuming you are trying to access the client 
global variable in main.c? I think that won't work
because you also define *client in main.c which overides the global (though I'm
not too sure on that one). Also you should call g_return_if_fail (client !=
NULL) before g_return_if_fail (GCONF_IS_CLIENT (client)) otherwise the client
!= NULL is pointless since GCONF_IS_CLIENT (client) should error if client is
NULL.

That should be the minimun necessary to get gconf working. You should also look into notification 
(gconf_client_notify_add), and install a schemas file also.

Regards,
Kevin

On Wed, 20 Feb 2002 22:09:27 +0100, Kim Schulz wrote:

hi all
I have started making a new program called GnetChange. It's for laptop
users so they can change their networksettings on-the-fly. To store all
the different network settings I want to use GConf, but I'm not 100%
familiar with how this works the smartest way. Is there anybody out
there knowledge about this and who wants to help me with answering my
questions - and maybe correct my code when im wrong.

Currently there's not much in the CVS, but there is a compilable version
that shows the GUI (and segfaults because of a GConf problem I haven't
worked out yet). http://sourceforge.net/projects/gnetchange

you can contact me via 
ICQ: 34456892 
or 
mail: kim gnome dk (not .org) 


Hope that sombody out there can see the need for this program and wants
to help me with it. 

Best regards
Kim Schulz

-- 

[              http://www.schulz.dk - En nørds bekendelser!            ]
[       http://www.guadec.org - tapas, beer and gnome to the people    ]
_______________________________________________
gnome-love mailing list
gnome-love gnome org
http://mail.gnome.org/mailman/listinfo/gnome-love








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