[Kde-bindings] KDE/kdebindings/ruby/qtruby

Richard Dale Richard_Dale at tipitina.demon.co.uk
Mon Jun 30 12:59:18 UTC 2008


SVN commit 826324 by rdale:

* Fixed a similar bug to the above description, but for where the target
  of a method call was being cast to the correct class. For instance,
  a call of parentWidget() on a Plasma::Applet() needed the correct cast
  to a QWidget for it to work. This fixes the strange error messages in
  Plasma applets like the clock, about zero pixmap sizes and QPainter
  problems.

CCMAIL: kde-bindings at kde.org


 M  +6 -0      ChangeLog  
 M  +1 -2      src/marshall_types.cpp  
 M  +13 -3     src/marshall_types.h  


--- trunk/KDE/kdebindings/ruby/qtruby/ChangeLog #826323:826324
@@ -6,6 +6,12 @@
 	  the same smoke module as the type of the instance. For instance,
 	  an instance of type Plasma::Applet wasn't being correctly cast
 	  to a QGraphicsLayoutItem, which caused a crash.
+	* Fixed a similar bug to the above description, but for where the target
+	  of a method call was being cast to the correct class. For instance,
+	  a call of parentWidget() on a Plasma::Applet() needed the correct cast
+	  to a QWidget for it to work. This fixes the strange error messages in
+	  Plasma applets like the clock, about zero pixmap sizes and QPainter
+	  problems.
 
 2008-06-28  Arno Rehn  <arno at arnorehn.de>
 
--- trunk/KDE/kdebindings/ruby/qtruby/src/marshall_types.cpp #826323:826324
@@ -529,8 +529,7 @@
 	if (_target != Qnil) {
 		smokeruby_object *o = value_obj_info(_target);
 		if (o != 0 && o->ptr != 0) {
-			_current_object = o->ptr;
-			_current_object_class = o->classId;
+			_current_object = o;
 		}
 	}
 
--- trunk/KDE/kdebindings/ruby/qtruby/src/marshall_types.h #826323:826324
@@ -144,7 +144,18 @@
 		}
 	
 		Smoke::ClassFn fn = _smoke->classes[method().classId].classFn;
-		void *ptr = _smoke->cast(_current_object, _current_object_class, method().classId);
+
+	
+		void * ptr = 0;
+
+		if (_current_object != 0) {
+			const Smoke::Class &cl = _smoke->classes[method().classId];
+
+			ptr = _current_object->smoke->cast(	_current_object->ptr,
+												_current_object->classId,
+												_current_object->smoke->idClass(cl.className, true).index );
+		}
+
 		_items = -1;
 		(*fn)(method().method, ptr, _stack);
 		MethodReturnValue r(_smoke, _method, _stack, &_retval);
@@ -154,8 +165,7 @@
 	bool cleanup();
 private:
 	VALUE _target;
-	void *_current_object;
-	Smoke::Index _current_object_class;
+	smokeruby_object * _current_object;
 	VALUE *_sp;
 	int _items;
 	VALUE _retval;



More information about the Kde-bindings mailing list