Re: how to use gnome_config??



On Wed, 26 May 1999, Wayne Schuller wrote:

> Here is an example code snippet:
>  str = gnome_config_get_string("/gmail/UserInfo/EmailAddress");
>   while (str == NULL) {
>     gnome_config_set_string("/gmail/UserInfo/EmailAddress", "This now has a
> value");
>     gnome_config_sync();  /* Write info to config file */
>     g_free(str);
>     str = gnome_config_get_string("/gmail/UserInfo/EmailAddress");
>     }
> 
> this code will loop infinitely. i can't see why... :(

It works fine for me.

I've attached the whole program I used to test it. If you build this
program (cc -o t t.c `gnome-config --cflags --libs gnome`), does it fail
for you?

If the tiny program works for you but your big program doesn't, blame goes
towards your big program. If the tiny program doesn't work for you, then
something's messed up with gnome-libs or your installation thereof, and we
need to find out what :)

-- Elliot
"We're sorry, we didn't know it was supposed to be invisible."
	- Sign carried outside US embassy.
#include <unistd.h>
#include <gnome.h>

int main(int argc, char *argv[])
{

char *str;
gnomelib_init("t", "0.0");
 str = gnome_config_get_string("/gmail/UserInfo/EmailAddress");
  while (str == NULL) {
    gnome_config_set_string("/gmail/UserInfo/EmailAddress", "This now has
a
value");
    gnome_config_sync();  /* Write info to config file */
    g_free(str);
    str = gnome_config_get_string("/gmail/UserInfo/EmailAddress");
    }

}


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