Re: libseed-list seed - GVariant /GDBus



This should get you going there.

http://www.roojs.org/seed/gir-1.2-gtk-2.0/seed/GLib.Variant.html

Looking at the introspection for the array, It does not look like it will work at present

The introspection gir looks like [below]. - the second parameter should be an array (however it's not picked up at present)

The fix will be adding a section to 

gobject-introspection/gir/glib-2.0.c 

something like this.
/**
 * g_variant_new_array:
 * @child_type:
 * @children: (array length=n_children) (element-type GVariantType*):
 */

Then rebuilding gobject-introspection, and hence the Glib gir.

Once you have it working file a bug against gobject-introspection (it's a subproject of glib) with the patch

Regards
Alan


  <constructor name="new_array" c:identifier="g_variant_new_array">
        <return-value transfer-ownership="full">
          <type name="Variant" c:type="GVariant*"/>
        </return-value>
        <parameters>
          <parameter name="child_type" transfer-ownership="none">
            <type name="VariantType" c:type="GVariantType*"/>
          </parameter>
          <parameter name="children" transfer-ownership="none">
            <type name="Variant" c:type="GVariant**"/>
          </parameter>
          <parameter name="n_children" transfer-ownership="none">
            <type name="gulong" c:type="gsize"/>
          </parameter>
        </parameters>
      </constructor>


 --- On 15/Jan/2011, tomw wrote: 
> Thanks, as always :-)
> 
> perhaps I've been not able to read the doc properly:
> 
> http://library.gnome.org/devel/glib/stable/glib-GVariant.html#g-variant-new-string
> 
> how should that look like for an array:
> 
> var a = new GLib.Variant.string("string a")
> var b = new GLib.Variant.string("string b")
> 
> new GLib.Variant.array(GLib.Variant.TYPE_STRING, [a,b], 2)
> 
> at least this is how I would read the docs:
> 
> http://library.gnome.org/devel/glib/stable/glib-GVariant.html#g-variant-new-array
> 
> On Fri, 2011-01-14 at 20:33 +0800, Alan Knowles wrote:
> > new GLib.Variant.string ("the string")
> > 
> > that's ones in the docs ;)
> 
> which docs are you referring to ?
> 
> > 
> > Regards
> > Alan
> > 
> > 
> >  --- On 11/Jan/2011, tomw wrote: 
> > > Hi folks,
> > > 
> > > in an attempt to use Gio.DBus instead of seed dbus I was trying to use
> > > GVariants. Unfortunately simple declaration which work perfectly well in
> > > Python do not work in seed.
> > > 
> > > Python:
> > > 
> > > >>> GLib.Variant.new_string("test")
> > > <GLib.Variant('test')>
> > > 
> > > >>> GLib.Variant("s", "test")
> > > <GLib.Variant('test')>
> > > 
> > > seed: 
> > > 
> > > > GLib.Variant.new_string("test");
> > > TypeError Result of expression 'GLib.Variant.new_string' [undefined] is
> > > not a function.
> > > 
> > > As seed dbus on dbus-glib does not work properly either
> > > (https://bugzilla.gnome.org/show_bug.cgi?id=615199) migrating to GDBus
> > > would be a potential solution to make dbus usage in seed applications
> > > work.
> > > 
> > > Any idea, how to solve the issue?
> > > 
> > > best, tomw
> > > 
> > > _______________________________________________
> > > libseed-list mailing list
> > > libseed-list gnome org
> > > http://mail.gnome.org/mailman/listinfo/libseed-list
> > 
> > _______________________________________________
> > libseed-list mailing list
> > libseed-list gnome org
> > http://mail.gnome.org/mailman/listinfo/libseed-list



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