[Kde-bindings] KDE/kdebindings/qtruby

Richard Dale Richard_Dale at tipitina.demon.co.uk
Thu Feb 8 04:41:54 UTC 2007


SVN commit 631454 by rdale:

* Fixed bugs in the debug dump of QMetaObjects created at runtime
* When a block was used as a slot, a new entry was being added to
  the QMetaObject object every time they were connected. A new
  entry is now only created if a slot with the same signature didn't
  already exist.

CCMAIL: kde-bindings at kde.org



 M  +9 -1      ChangeLog  
 M  +11 -4     rubylib/qtruby/Qt.cpp  
 M  +14 -8     rubylib/qtruby/lib/Qt/qtruby4.rb  


--- trunk/KDE/kdebindings/qtruby/ChangeLog #631453:631454
@@ -1,5 +1,13 @@
-2007-04-01  Richard Dale  <rdale at foton.es>
+2007-02-08  Richard Dale  <rdale at foton.es>
 
+	* Fixed bugs in the debug dump of QMetaObjects created at runtime
+	* When a block was used as a slot, a new entry was being added to
+	  the QMetaObject object every time they were connected. A new
+	  entry is now only created if a slot with the same signature didn't
+	  already exist.
+
+2007-02-04  Richard Dale  <rdale at foton.es>
+
 	* The ListModel internal class was being wrongly named as TableModel
 
 2007-02-01  Richard Dale  <rdale at foton.es>
--- trunk/KDE/kdebindings/qtruby/rubylib/qtruby/Qt.cpp #631453:631454
@@ -2421,19 +2421,26 @@
 	data[0], data[1], data[2], data[3], 
 	data[4], data[5], data[6], data[7], data[8], data[9]);
 
-	printf("\n // classinfo: key, value\n      %d,    %d\n", data[10], data[11]);
+	int s = data[3];
 
-	int s = 12;
+	if (data[2] > 0) {
+		printf("\n // classinfo: key, value\n");
+		for (uint j = 0; j < data[2]; j++) {
+			printf("      %d,    %d\n", data[s + (j * 2)], data[s + (j * 2) + 1]);
+		}
+	}
+
+	s = data[5];
 	bool signal_headings = true;
 	bool slot_headings = true;
 
 	for (uint j = 0; j < data[4]; j++) {
-		if (signal_headings && (data[s + (j * 5) + 4] & 0x04)) {
+		if (signal_headings && (data[s + (j * 5) + 4] & 0x04) != 0) {
 			printf("\n // signals: signature, parameters, type, tag, flags\n");
 			signal_headings = false;
 		} 
 
-		if (slot_headings && (data[s + (j * 5) + 4] & 0x08)) {
+		if (slot_headings && (data[s + (j * 5) + 4] & 0x08) != 0) {
 			printf("\n // slots: signature, parameters, type, tag, flags\n");
 			slot_headings = false;
 		}
--- trunk/KDE/kdebindings/qtruby/rubylib/qtruby/lib/Qt/qtruby4.rb #631453:631454
@@ -1939,9 +1939,11 @@
 	end
 
 	class SignalBlockInvocation < Qt::Object
-		def initialize(parent, block, args)
+		def initialize(parent, block, signature)
 			super(parent)
-			self.class.slots "invoke(#{args})"
+			if metaObject.indexOfSlot(signature) == -1
+				self.class.slots signature
+			end
 			@block = block
 		end
 
@@ -1951,9 +1953,11 @@
 	end
 
 	class BlockInvocation < Qt::Object
-		def initialize(target, block, args)
+		def initialize(target, block, signature)
 			super(target)
-			self.class.slots "invoke(#{args})"
+			if metaObject.indexOfSlot(signature) == -1
+				self.class.slots signature
+			end
 			@target = target
 			@block = block
 		end
@@ -2438,19 +2442,21 @@
 		end
 
 		def Internal.connect(src, signal, target, block)
-			signature = (signal =~ /\((.*)\)/) ? $1 : ""
+			args = (signal =~ /\((.*)\)/) ? $1 : ""
+			signature = Qt::MetaObject.normalizedSignature("invoke(%s)" % args).to_s
 			return Qt::Object.connect(	src,
 										signal,
 										Qt::BlockInvocation.new(target, block, signature),
-										SLOT("invoke(#{signature})") )
+										SLOT(signature) )
 		end
 
 		def Internal.signal_connect(src, signal, block)
-			signature = (signal =~ /\((.*)\)/) ? $1 : ""
+			args = (signal =~ /\((.*)\)/) ? $1 : ""
+			signature = Qt::MetaObject.normalizedSignature("invoke(%s)" % args).to_s
 			return Qt::Object.connect(	src,
 										signal,
 										Qt::SignalBlockInvocation.new(src, block, signature),
-										SLOT("invoke(#{signature})") )
+										SLOT(signature) )
 		end
 	end # Qt::Internal
 



More information about the Kde-bindings mailing list