[Kde-bindings] [Bug 229784] qtruby can't handle properties.

Richard Dale richard.dale at telefonica.net
Sun Mar 7 22:46:44 UTC 2010


https://bugs.kde.org/show_bug.cgi?id=229784





--- Comment #2 from Richard Dale <richard dale telefonica net>  2010-03-07 23:46:42 ---
On Sunday 07 March 2010 09:36:47 am ruby.twiddler at gmail.com wrote:
> https://bugs.kde.org/show_bug.cgi?id=229784
> 
> 
> 
> 
> 
> --- Comment #1 from  <ruby twiddler gmail com>  2010-03-07 10:35:26 ---
> here is a my try of fixing the bug for reference.
> 
> diff -x .svn -uNrb kdebindings-latest/ruby/qtruby/src/Qt.cpp
> kdebindings-fix/ruby/qtruby/src/Qt.cpp
> --- kdebindings-latest/ruby/qtruby/src/Qt.cpp    2010-03-05
> 11:10:05.000000000 +0900
> +++ kdebindings-fix/ruby/qtruby/src/Qt.cpp    2010-03-07 17:55:23.000000000
> +0900
> @@ -830,11 +830,15 @@
>                      // Check for property getter/setter calls, and for
> slots in QObject classes
>                      // not in the smoke library
>                      smokeruby_object *o = value_obj_info(self);
> +                                        static Smoke::ModuleIndex qobjId =
> Smoke::NullModuleIndex;
> +                                        if (qobjId.index == 0) {
> +                                            qobjId =
> Smoke::findClass("QObject");
> +                                        }
>                      if (    o != 0
>                              && o->ptr != 0
> -                            && o->smoke->isDerivedFrom(o->smoke,
> o->classId, o->smoke->idClass("QObject").smoke,
> o->smoke->idClass("QObject").index) ) +                            &&
> o->smoke->isDerivedFrom(o->smoke, o->classId, qobjId.smoke, qobjId.index )
> )
>                      {
> -                        QObject * qobject = (QObject *)
> o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("QObject").index);
> +                                            QObject * qobject = (QObject
> *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("QObject",
> true).index); static QByteArray * name = 0;
>                          if (name == 0) {
>                              name = new QByteArray();
Thanks for the bug report and patch - I've fixed the code as per the patch, 
apart from not adding the 'qobjid' intermediate variable and just called 
Smoke::findClass("QObject") in the condition directly.

-- Richard

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Kde-bindings mailing list