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

Davor Ocelic docelic at spinlocksolutions.com
Thu Nov 12 14:13:13 UTC 2009


On Thu, 12 Nov 2009 13:55:30 +0000
Richard Dale <Richard_Dale at tipitina.demon.co.uk> wrote:

> SVN commit 1047977 by rdale:
> 
> * The Qt::SizePolicy.horizontalStretch= method wasn't working with a
> Smoke library created with the new generator as the type 'unsigned
> char' wasn't recognized. Thanks to Stefano Crocco for reporting the
> bug.

I think this is handled in a patch that I sent to the list a month
ago, but it received no coverage.

Here's again the patch and the patch comments:

---
Here's an overview of the changes:


ruby/qtruby/src/handlers.cpp:

Added { "unsigned char*", marshall_ucharP } so that conversion
from String to "unsigned char*" would work. Qt code doesn't
have unsigned char*, but Smoke seems to internally convert
uchar* to unsigned char*.


ruby/qtruby/src/Qt.cpp:

The code at the place of patch checks whether a method is overriden
in Ruby. But during GC, it's not allowed to execute Ruby code anyway,
so the patch removes this check altogether. (In rare, but existing
situations, this check itself lead to new object allocation, crashing
the application).

(New info: the function we've used to check if it's running during
GC or not seems to be Ruby 1.9 specific, so a simple compatibility
for 1.8 should be added before committing).


ruby/qtruby/src/lib/Qt/qtruby4.rb

1) Added GC.disable around line of code that says: "@block = block".
This makes a difference between being and being not able to run
with GC.stress= true. Reason unclear, comments appreciated.

2) Extended typename =~ /^(?:u?char\*)$/ checks to support 
unsigned char.

3) Skip "def instance_exec" if it is already defined
(it is in Ruby 1.9)


Best regards,
Davor Ocelic
Spinlock Solutions
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdebindings-22sep2009.patch
Type: text/x-patch
Size: 2394 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20091112/c8bd10f1/attachment.patch>


More information about the Kde-bindings mailing list