[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.4/kdebindings/ruby/qtruby
From:       Richard Dale <richard.j.dale () gmail ! com>
Date:       2010-06-22 2:44:26
Message-ID: 20100622024426.5052EAC8DC () svn ! kde ! org
[Download RAW message or body]

SVN commit 1141031 by rdale:

* Added snakecase versions of the methods in the Qt::DBusConnectionInterface
  class
* Fixed bug with missing QVector<double> marshaller. Fixes problem reported
  by Sylvain Sauvage http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=586672
  Thanks for the bug report.
* Add a version check when using rb_during_gc() as it was only added for 
  Ruby 1.8.7
* Added a setScriptOwnership= method for changing whether an instance is owned
  by the C++ or Ruby runtimes



 M  +12 -0     ChangeLog  
 M  +4 -0      src/Qt.cpp  
 M  +2 -0      src/handlers.cpp  
 M  +28 -0     src/lib/Qt/qtruby4.rb  
 M  +14 -0     src/qtruby.cpp  


--- branches/KDE/4.4/kdebindings/ruby/qtruby/ChangeLog #1141030:1141031
@@ -1,3 +1,15 @@
+2010-06-22  Richard Dale  <richard.j.dale@gmail.com>
+
+    * Added snakecase versions of the methods in the Qt::DBusConnectionInterface
+      class
+    * Fixed bug with missing QVector<double> marshaller. Fixes problem reported
+      by Sylvain Sauvage http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=586672
+      Thanks for the bug report.
+    * Add a version check when using rb_during_gc() as it was only added for 
+      Ruby 1.8.7
+    * Added a setScriptOwnership= method for changing whether an instance is owned
+      by the C++ or Ruby runtimes
+
 2010-03-14  Richard Dale  <richard.j.dale@gmail.com>
 	
 	* The QtDBus classes weren't being correctly initialized as the count of 
--- branches/KDE/4.4/kdebindings/ruby/qtruby/src/Qt.cpp #1141030:1141031
@@ -270,7 +270,11 @@
 	}
 		// If the virtual method hasn't been overriden, just call the C++ one.
 		// During GC, avoid checking for override and just call the C++ version
+#if RUBY_VERSION < 0x10807
+	if (rb_respond_to(obj, rb_intern(methodName)) == 0) {
+#else
 	if (rb_during_gc() || rb_respond_to(obj, rb_intern(methodName)) == 0) {
+#endif
     	return false;
 	}
 	QtRuby::VirtualMethodCall c(smoke, method, args, obj, ALLOCA_N(VALUE, \
                smoke->methods[method].numArgs));
--- branches/KDE/4.4/kdebindings/ruby/qtruby/src/handlers.cpp #1141030:1141031
@@ -2508,6 +2508,8 @@
     { "QVector<QPoint>&", marshall_QPointVector },
     { "QVector<qreal>", marshall_QVectorqreal },
     { "QVector<qreal>&", marshall_QVectorqreal },
+    { "QVector<double>", marshall_QVectorqreal },
+    { "QVector<double>&", marshall_QVectorqreal },
     { "QVector<QRectF>", marshall_QRectFVector },
     { "QVector<QRectF>&", marshall_QRectFVector },
     { "QVector<QRect>", marshall_QRectVector },
--- branches/KDE/4.4/kdebindings/ruby/qtruby/src/lib/Qt/qtruby4.rb #1141030:1141031
@@ -709,30 +709,58 @@
     		return Qt::DBusReply.new(internalConstCall(Qt::DBus::AutoDetect, \
"GetNameOwner", [Qt::Variant.new(name)]))  end
 
+		def service_owner(name)
+    		return serviceOwner(name)
+		end
+
 		def registeredServiceNames
 			return Qt::DBusReply.new(internalConstCall(Qt::DBus::AutoDetect, "ListNames"))
 		end
 
+		def registered_service_names
+			return registeredServiceNames
+		end
+
 		def isServiceRegistered(serviceName)
     		return Qt::DBusReply.new(internalConstCall(Qt::DBus::AutoDetect, \
"NameHasOwner", [Qt::Variant.new(serviceName)]))  end
 
+		def is_service_registered(serviceName)
+    		return isServiceRegistered(serviceName)
+		end
+
 		def serviceRegistered?(serviceName)
     		return isServiceRegistered(serviceName)
 		end
 
+		def service_registered?(serviceName)
+    		return isServiceRegistered(serviceName)
+		end
+
 		def servicePid(serviceName)
     		return Qt::DBusReply.new(internalConstCall(Qt::DBus::AutoDetect, \
"GetConnectionUnixProcessID", [Qt::Variant.new(serviceName)]))  end
 
+		def service_pid(serviceName)
+    		return servicePid(serviceName)
+		end
+
 		def serviceUid(serviceName)
     		return Qt::DBusReply.new(internalConstCall(Qt::DBus::AutoDetect, \
"GetConnectionUnixUser", [Qt::Variant.new(serviceName)]))  end
 
+		def service_uid(serviceName)
+    		return serviceUid(serviceName)
+		end
+
 		def startService(name)
     		return call("StartServiceByName", Qt::Variant.new(name), \
Qt::Variant.new(0)).value  end
+
+		def start_service(name)
+    		startService(name)
 	end
+	end
 
 	class DBusError < Qt::Base 
 		def type(*args)
--- branches/KDE/4.4/kdebindings/ruby/qtruby/src/qtruby.cpp #1141030:1141031
@@ -1982,6 +1982,17 @@
 	return (o != 0 && o->ptr != 0) ? Qfalse : Qtrue;
 }
 
+static VALUE
+set_script_ownership(VALUE self, VALUE value)
+{
+	smokeruby_object *o = value_obj_info(self);
+	if (o != 0) {
+		o->allocated = RTEST(value);
+	}
+	
+	return self;
+}
+
 VALUE
 isQObject(VALUE /*self*/, VALUE c)
 {
@@ -2372,6 +2383,9 @@
     rb_define_method(qt_base_class, "isDisposed", (VALUE (*) (...)) is_disposed, 0);
     rb_define_method(qt_base_class, "disposed?", (VALUE (*) (...)) is_disposed, 0);
 
+    rb_define_method(qt_base_class, "scriptOwnership=", (VALUE (*) (...)) \
set_script_ownership, 1); +    rb_define_method(qt_base_class, "script_ownership=", \
(VALUE (*) (...)) set_script_ownership, 1); +
 	rb_define_method(qt_base_class, "qVariantValue", (VALUE (*) (...)) qvariant_value, \
2);  rb_define_method(qt_base_class, "qVariantFromValue", (VALUE (*) (...)) \
qvariant_from_value, -1);  


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic