[Kde-bindings] KDE/kdebindings/ruby/qtruby
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Sun Feb 1 17:31:44 UTC 2009
SVN commit 919850 by rdale:
* The construct_copy() function was using the full classname of the class
to construct which meant that it didn't work with classnames containing
'::' scope operators. So strip out the scope part of the classname to
create the consructor name.
* Make Qt::Internal#try_initialize catch a ':newqt' symbol rather than a
string.
CCMAIL: kde-bindings at kde.org
M +8 -0 ChangeLog
M +9 -4 src/handlers.cpp
M +1 -1 src/lib/Qt/qtruby4.rb
--- trunk/KDE/kdebindings/ruby/qtruby/ChangeLog #919849:919850
@@ -1,3 +1,11 @@
+2009-02-01 Richard Dale <richard.j.dale at gmail.com>
+ * The construct_copy() function was using the full classname of the class
+ to construct which meant that it didn't work with classnames containing
+ '::' scope operators. So strip out the scope part of the classname to
+ create the consructor name.
+ * Make Qt::Internal#try_initialize catch a ':newqt' symbol rather than a
+ string.
+
2009-01-14 Richard Dale <richard.j.dale at gmail.com>
* For the enum values whose names clashed with Ruby classes, make them
Qt::Enums instead of just Fixnums
--- trunk/KDE/kdebindings/ruby/qtruby/src/handlers.cpp #919849:919850
@@ -699,11 +699,16 @@
{
const char *className = o->smoke->className(o->classId);
int classNameLen = strlen(className);
- char *ccSig = new char[classNameLen + 2]; // copy constructor signature
- strcpy(ccSig, className);
- strcat(ccSig, "#");
+
+ // copy constructor signature
+ QByteArray ccSig(className);
+ int pos = ccSig.lastIndexOf("::");
+ if (pos != -1) {
+ ccSig = ccSig.mid(pos + strlen("::"));
+ }
+ ccSig.append("#");
+
Smoke::ModuleIndex ccId = o->smoke->findMethodName(className, ccSig);
- delete[] ccSig;
char *ccArg = new char[classNameLen + 8];
sprintf(ccArg, "const %s&", className);
--- trunk/KDE/kdebindings/ruby/qtruby/src/lib/Qt/qtruby4.rb #919849:919850
@@ -2525,7 +2525,7 @@
# wrapped in a new ruby variable of type T_DATA
def Internal.try_initialize(instance, *args)
initializer = instance.method(:initialize)
- catch "newqt" do
+ catch :newqt do
initializer.call(*args)
end
end
More information about the Kde-bindings
mailing list