[Kde-bindings] minor qtruby query (was Re: kdebindings/qtruby)

Alexander Kellett lypanov at kde.org
Sat Aug 2 13:58:03 UTC 2003


heya Richard ;-)

okay. i've just commited this quick patch
as i'm getting a ton of deprecation warnings
when running with ruby 1.8.x, this removes
the ones that i was seeing at least. but,
there was a bit of strange code that i'm
not sure i rewrote perfectly.

> -                classname = aClass.name if aClass.type <= Module

which i've replaced with 

> +                classname = aClass.name if aClass.is_a? Module

i'm really quite unsure what exactly
you were trying to do here?

ri 'Module.<=' =>

------------------------------------------------------------- Module#<=>
     mod <=> aModule -> -1, 0, +1
------------------------------------------------------------------------
     Comparison---Returns -1 if mod includes aModule, 0 if mod is the
     same as aModule, and +1 if mod is included by aModule or if mod has
     no relationship with aModule.

in any case i tested all the tutorials
again with my latest version and other
than a few missing super's (which i've
added and commited) they work pretty 
well. so, maybe i'm missing something
about the statements purpose?

i've updated the ChangeLog with notes
about this an a number of other changes.

cheers,
Alex

On Sat, Aug 02, 2003 at 12:08:44PM +0200, Alexander Kellett wrote:
> CVS commit by lypanov: 
> deprecation warning fixes when running under ruby 1.8.x
> 
>   M +7 -7      rubylib/qtruby/lib/Qt/Qt.rb   1.3
> 
> --- kdebindings/qtruby/rubylib/qtruby/lib/Qt/Qt.rb  #1.2:1.3
> @@ -159,5 +159,5 @@
>                  
>          def hasMembers(aClass)
> -                classname = aClass.name if aClass.type <= Module
> +                classname = aClass.name if aClass.is_a? Module
>                  meta = Meta[classname]
>                  return meta != nil && (meta.signals.length > 0 or meta.slots.length > 0)
> @@ -165,5 +165,5 @@
>  
>          def getSignalNames(aClass)
> -                classname = aClass.name if aClass.type <= Module
> +                classname = aClass.name if aClass.is_a? Module
>                  signalNames = Array.new
>                  signals = Meta[classname].signals
> @@ -177,10 +177,10 @@
>          
>          def signalInfo(qobject, signalName)
> -                classname = qobject.class.name if qobject.class.type <= Module
> +                classname = qobject.class.name if qobject.class.is_a? Module
>                  signals = Meta[classname].signals
>                  i = 0
>                  result = Array.new
>                  for signal in signals
> -                        if signal.sub(/\(.*/, '') =~ signalName
> +                        if signal.sub(/\(.*/, '').include? signalName
>                                  result.push(signal)
>                                  result.push(i)
> @@ -192,10 +192,10 @@
>                  
>          def signalAt(qobject, index)
> -                classname = qobject.class.name if qobject.class.type <= Module
> +                classname = qobject.class.name if qobject.class.is_a? Module
>                  return Meta[classname].signals[index]
>          end
> -        
> +
>          def slotAt(qobject, index)
> -                classname = qobject.class.name if qobject.class.type <= Module
> +                classname = qobject.class.name if qobject.class.is_a? Module
>                  return Meta[classname].slots[index]
>          end
> 
> 


More information about the Kde-bindings mailing list