GNOME Bugzilla – Bug 695715
Use DBus calls instead of Avahi API
Last modified: 2013-03-13 15:36:24 UTC
Created attachment 238708 [details] [review] use DBus calls instead of Avahi API Current Gtk+ requires avahi-gobject for compilation with support for Avahi-advertised printers. This can lead to circular dependency as noted in https://bugzilla.gnome.org/show_bug.cgi?id=695127. Attached patch turns these avahi-gobject API calls to DBus calls and removes the dependency on avahi-gobject. The patch has to be applied after the patches from https://bugzilla.gnome.org/show_bug.cgi?id=695713 and https://bugzilla.gnome.org/show_bug.cgi?id=695714.
Review of attachment 238708 [details] [review]: looks good to me
Comment on attachment 238708 [details] [review] use DBus calls instead of Avahi API Thank you for the review. I've pushed the patch to gtk-3-8 and master.
+ g_variant_get (output, "(ii&s&s&s&si&sq@aayu)", [....] + for (i = 0; i < g_variant_n_children (txt); i++) + { + child = g_variant_get_child_value (txt, i); + + tmp = g_new0 (gchar, g_variant_n_children (child) + 1); + for (j = 0; j < g_variant_n_children (child); j++) + { + tmp[j] = g_variant_get_byte (g_variant_get_child_value (child, j)); + } + That doesn't look very clean... GVariant has built-in support for bytestrings and arrays thereof, so you can just use "^a&ay" in the format string instead of "@aay", and get a strv out directly.
(In reply to comment #3) > That doesn't look very clean... GVariant has built-in support for bytestrings > and arrays thereof, so you can just use "^a&ay" in the format string instead of > "@aay", and get a strv out directly. Hi Christian, I think that it is not elegant too but the "^a&ay" doesn't work in this case. I tried it again now and I still can not get a usable result from that. It returns me just empty strings. I'll try to look at it later and I will fill a bug for this if I will find any. Regards Marek