[Spice-devel] [PATCH spice-gtk 08/15] gtk: do not require glib session private fields

Marc-André Lureau marcandre.lureau at gmail.com
Wed Nov 26 05:02:57 PST 2014


Hi

On Wed, Nov 26, 2014 at 12:05 AM, Jonathon Jongsma <jjongsma at redhat.com> wrote:
> So, you just added internal accessor functions for a bunch of other
> session member variables (_get_webdav_magic(), etc.). But for these, you
> used the GObject data functions. Why are these variables treated
> differently? By using g_object_get|set_data(), you lose some type
> safety, and make things harder to debug since you can't look directly at
> struct members, etc. I'd really rather just add setters/getters for
> these variables.

Right, I should have explained the reason. The problem is gtk-session
and desktop-integration are in the gtk library SpiceSession is in
glib. So far we had the SessionPriv structure shared between the two
libraries, so they could fit their pointers there. But this is no
longer possible when moving the private structure in .c. We could had
more accessors, but they would need to be in public API, and this
isn't supposed to be accessed by API users. Thus, I think GObject data
usage is justified here.


-- 
Marc-André Lureau


More information about the Spice-devel mailing list