Re: [Nautilus-list] Nautlius GConf preliminary patch

Håvard Wigtil <havardw stud ntnu no> writes:
> I've been trying to remove (the deprecated) gnome_config from Nautlius
> and replace it with GConf.
> I've started on getting and updating desktop settings, and have
> attatched a patch. This patch is in no way ready for the tree yet, but I
> need some advice on the general direction and some spesifics.

You want to be sure to look at
You probably want to use those features so that Nautilus default error
handlers and such kick in.
> Can someone take a look at it and tell me if I'm heading in the right
> direction. Is it something obvious that I've missed?

It's basically the right idea, yep. A couple specific comments follow.

> Also, what would be the correct place to attach a GConfClinet to the
> view, and the proper place to destroy it? (And am I right in the
> assumption that if I unref the client in nautilus_desktop_set_background
> the callback won't work)?

It's fine to unref the client there because gnome-libs and eel are
holding references to it. Though really one shouldn't rely on that sort of
thing. ;-) I think using the Eel wrapper functions will solve the
problem for you. But failing that, you can probably just unref the 
GConfClient when the view gets destroyed...

> +        // FIXME: Need to check for valid string
> +        color = gconf_value_get_string(entry->value);

entry->value is NULL if the value is unset. So you want to handle that
case, probably by doing nothing, just return from the notify.

(The case isn't supposed to happen in normal usage, because the schema
defaults are supposed to be available. So just ignoring the notify is
a low-tech response that works.)

> +	if (old_file == file) {
> +                g_error("Trying to set desktop directory to
> existing directory. (file==old_file)\n");

I wouldn't put any g_error() in CVS - g_error() should only be used to 
indicate a programming error, i.e. it's like g_assert_not_reached()
with an explanation.


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