Bug 229784 - qtruby can't handle properties.
Summary: qtruby can't handle properties.
Status: RESOLVED WORKSFORME
Alias: None
Product: bindings
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kde-bindings
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-07 10:26 UTC by ruby.twiddler
Modified: 2023-01-06 05:23 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ruby.twiddler 2010-03-07 10:26:11 UTC
Version:           Rev: 1097205 Last Changed Date: 2010-03-01 (using KDE 4.4.0)
OS:                Linux
Installed from:    Compiled From Sources

in qtruby scripts 
when accessing properties, cause method missing error.

-- code snippet
l = Qt::LineEdit.new
puts l.modified
puts l.undoAvailable

like these properties which has different name from real accessing method (in the above example, modified is accessed by isModified method)
cause method missing error.
Comment 1 ruby.twiddler 2010-03-07 10:35:26 UTC
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();
Comment 2 Richard Dale 2010-03-07 23:46:42 UTC
On Sunday 07 March 2010 09:36:47 am ruby.twiddler@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
Comment 3 ruby.twiddler 2010-03-09 09:47:08 UTC
Thank you very much for your quick update.
Comment 4 Andrew Crouthamel 2018-11-02 22:54:49 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 5 Andrew Crouthamel 2018-11-16 02:41:59 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version?

Thank you for helping us make KDE software even better for everyone!
Comment 6 Justin Zobel 2022-12-07 00:23:57 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 7 Bug Janitor Service 2022-12-22 05:19:53 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 8 Bug Janitor Service 2023-01-06 05:23:40 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!