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

Re: GConf question



On Sat, 2004-03-06 at 07:43, Emmanuele Bassi wrote:
> * James Curbo <james teyandei net>:
> 
> > $client->set_list($app_key, 'string', \ data);
> > my $outdata = $client->get_list($app_key);
> 
> [Thanks for testing lists: I've done my test cases, but more testing is
> always welcome.]
> 
> You should not do this, at any rate: you should always attach a notify
> callback in order to check the changes. The changes inside the GConf
> database are committed when the user daemon "decides" so; there's no way
> to guarantee that these changes apply immediately (especially since
> those changes are stored inside a filesystem, with latencies and such),
> and that calling a get right after a set returns correct data.
> 
> This should always work, as this is the way it should be done:
> 
> 	$client->notify_add("/apps/curboj/", sub {
> 			my ($client, $cnxn_id, $entry) = @_;
> 
> 			print Dumper($entry->{value});
> 		});
> 	$client->set_list($app_key, 'string', \ data);

OK, I understand this. However even with keys I set last night inside
gconf-editor, I still get an array of undef's when I query with
get_list... however it is the same size as the list I'm trying to get.
For instance, the list I'm trying to grab has two items in it, and
get_list is returning an arrayref with two undefs in it. I was getting
the same result last night with a list with three items in it (was
returning three undefs). get_string works as expected.

Am I missing something obvious here?

> 
> Regards,
>  Emmanuele.
-- 
James Curbo <james teyandei net>
http://teyandei.net/
GPG Fingerprint: AA8B D78D 6789 84E2 17A5 0F2A C4CA 6A55 0A4B 263F

Attachment: signature.asc
Description: This is a digitally signed message part



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