About XfconfChannel Object

Brian J. Tarricone bjt23 at cornell.edu
Sat Sep 20 21:45:04 CEST 2008


Ok, TRIM YOUR REPLIES.  I really don't appreciate having to dig through
huge unrelated quoted portions of the digest to find your reply.

On Sat, 20 Sep 2008 13:42:12 +0200 ali abdallah wrote:

> On Sat, Sep 20, 2008 at 12:32 PM, Brian Tarricone wrote:
> > ali abdallah wrote:
> > > Hi,
> > >
> > > Why the XfconfChannel and XfconfChannelClass are defined in the
> > > xfconf-channel.c, i'm asking this question since i couldn't
> > > derive an object
> > > from the XfconfChannel object!
> >
> > Er, why do you want to?  I assumed no one would.
> >
> > Not saying you don't have a valid use-case, but I'd rather not go
> > and change things without a reason.
> >
> I wanted to have an object wish is derived from XfconfChannel object
> and contains more data and functions to be used in my application,
> then i can call the *channel_get* and *channel_set* functions by
> casting the object to XfconfChannel type, just like a GtkWidget and
> GtkButton for example.

So are you actually *extending* the XfconfChannel type?  I mean, are
you actually adding settings-related functionality to it, or are you
just using subclassing as a quick-and-dirty shortcut to avoid having to
carry around an extra pointer?

If you're actually extending the object, I'd consider making the class
struct public, but otherwise you should just be using
g_object_set_data() to carry around a pointer to the XfconfChannel, or
stuffing it in a struct that has other data you're passing around.

> I'm not asking any change, if this will stay like that i'll respect
> the API of xfconf ( but i rarely see the object struct and class
> struct defined in the .c source), but it's not a big issue, anyway
> xfconf is alreay a perfect application to use.

Haha, thanks, but I'm well aware it's far from perfect!

> Note: xfconf-query gives segmentation fault if the daemon is not
> running.

Hmm, thanks for the catch -- it's pretty harmless but of course
shouldn't do that.  Of course, if you have dbus set up properly,
barring any bugs, xfconfd should get launched on demand, so "not
running" isn't really a valid state.

	-brian



More information about the Xfce4-dev mailing list