Re: Way to remove a GConf dir ?



Hi Alexandre,

On Mon, 2005-09-12 at 20:48 +0200, Alexandre Jousset wrote:
      Hello again...

      I'm using Gnome2::GConf and it's great ! (already seen this expression 
;-) )

      But I would like to know if there is a mean to remove a dir. There is 
$client->unset($key) for a key but it does not seem to work for dirs... 
I have not found anything in the Gtk2-Perl doc nor in the Gnome C 
API..........?????

The method is Gnome2::GConf::Client::remove_dir.

But I actually don't think that those methods actually do what you think
they actually do.

Ehr...

Okay, let's start again.  Gnome2::GConf::Client::unset does *not* delete
a key from the GConf database: it merely puts it in an "unset" state -
which will result in having the value fetched from the default value (if
any) specified in the attached schema (if any).

Gnome2::GConf::Client::remove_dir removes a GConf "directory" from the
list of the watched directories - it does *not* remove the directory
from the GConf database.

The only way to actually delete a directory would be to use the
Gnome2::GConf::Engine::remove_dir method - but you should never ever do
this, under any circumstances, unless you really know what you're doing.
And unless you say "klaatu barada nikto" while you're doing it,
otherwise things could get really messy.

[ Just looking at the code, anyway, it seems that no check is performed
on the owner of the engine, so it could be possible to get away with it
- but it's not guaranteed to work now or in the future.]

Regards,
 Emmanuele.

-- 
Emmanuele Bassi - <ebassi gmail com>
Log: http://log.emmanuelebassi.net




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