[Kde-bindings] Ruby: various DBus int variants

Arno Rehn arno at arnorehn.de
Tue Aug 3 12:56:58 UTC 2010


On Tuesday 03 August 2010 14:53:41 Richard Dale wrote:
> On Tuesday, August 03, 2010 01:41:02 pm Arno Rehn wrote:
> > On Sunday 01 August 2010 21:23:20 Sylvain Sauvage wrote:
> > > Hi all,
> > > 
> > > DBus integers can be 16, 32, or 64 bits, signed or unsigned, but
> > > I can’t find a way to make a matching Qt::Variant in Ruby (for
> > > DBus arguments are Qt::Variants).
> > > 
> > > In the 2006-12-04 entry of qtruby Changelog, it reads:
> > >   1095  * Add an option extra argument to Qt::Variant.fromValue() and
> > >   1096  qVariantFromValue
> > >   1097            to specify a type string, for use with QtDBus args.
> > >   For
> > > 
> > > example: 1098
> > > 
> > >   1099                  v = Qt::Variant.fromValue(5, "uint")
> > >   1100
> > >   1101            Will force the Qt::Variant to be a specific type
> > > 
> > > (line numbers from June 22th’s version (websvn)).
> > > 
> > > But it doesn’t work anymore:
> > > Qt::Variant.fromValue( 0, 'uint' )
> > > => #<Qt::Variant:0x7f3a5b86bdb0 typeName=int>
> > > 
> > > Is there a new way?
> > 
> > The type name has changed to 'unsigned int' - however it then crashes.
> > Have to investigate that.
> 
> It should be the same as whatever QVariant::typeName() returns for the type
> which I expect is still "uint". But ideally it shouldn't crash.
It looks for the method signature as it is in Smoke, and Smoke only knows 
about 'unsigned int' (or 'long long' instead of 'qlonglong' for that matter).

-- 
Arno Rehn
arno at arnorehn.de



More information about the Kde-bindings mailing list