Re: remove_dir() and notifies



Byron Ellacott <bje apnic net> writes:
> I am working on an ncurses interface to browse and edit the gconf
> database.

Cool!

>   Currently, the code can browse entries, and responds correctly
> (it seems :) to entry inserts, deletes and changes.  What I *know* the
> code currently will spit on is the removal of a path.
> 
> I don't handle this case for two reasons - first, the lack of the API
> function makes it a little harder to test, and second, the notification
> callback is triggered with a *key* name, not a path.
> 
> How, then, does an application get notification that a path in the
> namespace it is watching has just vanished?
> 
> (my code takes care of paths appearing when a key is inserted already.)
> 
> I'll have the code available for download in a few days time, after I tidy
> the proof-of-conceptness up.
> 

There isn't any notification of directory removal (or addition, for
that matter) at the moment. My suggestion for now would be to just
only display directories in the UI if they contain entries, I guess.

Need to think about whether and how to add notification of directory
removal - I'm not sure one really cares about empty directories one
way or the other in GConf. They aren't hurting or helping anything by
existing. So having UIs just ignore them seems like it might be
simpler than complicating the notification mechanism.

Addition of directories already works this way, directories just
magically appear if you use a key that's inside them. So having them
magically disappear when there are no keys inside them seems sensible.

Perhaps rather than having UIs ignore them, we could actually ensure
that they are gone (don't appear in all_dirs listings) once they are
empty. When a key is deleted, a UI could then just rescan the
directory the key was inside to see if it's gone.

Havoc




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