[Kde-bindings] kdebindings/qtruby

Richard Dale Richard_Dale at tipitina.demon.co.uk
Tue Oct 5 22:05:57 UTC 2004


CVS commit by rdale: 


* Given a C++ instance and an approximate classname, the QtRuby runtime uses the 
various Qt rtti mechanisms such as QObject::className() to improve the resolution 
of the name. However, the numeric classId into the array of classnames in the Smoke 
runtime was not being updated in line with the more accurate name.  
* This caused problems with method argument matching which uses the numeric classId 
rather than the ruby object's classname, and so QtRuby wrongly assumed that a an 
instance of a Qt::Widget was a Qt::Object. 
* Fixes problem reported by Han Holl 

CCMAIL: kde-bindings at kde.org 


  M +13 -0     ChangeLog   1.120
  M +5 -1      rubylib/qtruby/Qt.cpp   1.94


--- kdebindings/qtruby/rubylib/qtruby/Qt.cpp  #1.93:1.94
@@ -839,4 +839,8 @@ set_obj_info(const char * className, smo
                              1,
                              rb_str_new2(className) );
+        Smoke::Index *r = classcache.find(className);
+        if (r != 0) {
+                o->classId = (int)*r;
+        }
     VALUE obj = Data_Wrap_Struct(klass, smokeruby_mark, smokeruby_free, (void *) o);
     return obj;
@@ -885,5 +889,5 @@ get_VALUEtype(VALUE ruby_value)
     else if(strcmp(classname, "Qt::ByteArray") == 0)
         r = "b";
-    else if(strcmp(classname, "Qt::Boolean") == 0)
+    else if(ruby_value == Qtrue || ruby_value == Qfalse || strcmp(classname, "Qt::Boolean") == 0)
         r = "B";
     else if(strcmp(classname, "Qt::Enum") == 0) {

--- kdebindings/qtruby/ChangeLog  #1.119:1.120
@@ -1,4 +1,17 @@
 2004-10-05  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
+ * Given a C++ instance and an approximate classname, the QtRuby runtime uses the
+   various Qt rtti mechanisms such as QObject::className() to improve the resolution
+   of the name. However, the numeric classId into the array of classnames in the Smoke
+   runtime was not being updated in line with the more accurate name. 
+ * This caused problems with method argument matching which uses the numeric classId
+   rather than the ruby object's classname, and so QtRuby wrongly assumed that a an
+   instance of a Qt::Widget was a Qt::Object.
+ * Fixes problem reported by Han Holl
+
+ CCMAIL: kde-bindings at kde.org
+
+2004-10-05  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
+
  * Fixed a couple of errors in the rbuic generated code found as a result of
    the recently improved stricter arg type matching.





More information about the Kde-bindings mailing list