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

Re: GConf question



* 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);

Regards,
 Emmanuele.

-- 
Emmanuele Bassi (Zefram)                 [ http://www.emmanuelebassi.net ]
GnuPG Key fingerprint = 4DD0 C90D 4070 F071 5738  08BD 8ECC DB8F A432 0FF4



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