[Kde-bindings] KDE/kdebindings/ruby/qtruby
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Mon Jun 18 14:14:48 UTC 2007
SVN commit 677126 by rdale:
* When a signal is defined, and Ruby method is created to call it. Before
the signal methods were only being created when the Qt::MetaObject for
a class was created. This caused problems if the signal was emitted
before the Qt::MetaObject was created. Fixes problem reported for Qt3
QtRuby by Gadi Aleksandrowicz on the Korundum Rubyforge help forum.
CCMAIL: kde-bindings at kde.org
M +5 -0 ChangeLog
M +1 -1 src/Qt.cpp
M +3 -10 src/lib/Qt/qtruby4.rb
--- trunk/KDE/kdebindings/ruby/qtruby/ChangeLog #677125:677126
@@ -5,6 +5,11 @@
hack was used where a Qt::MetaObject containing all the slots and
signal of its superclass too, was constructed for the twice sub-classed
class. Fixes problems reported by Caleb Tennis amoungst several others.
+ * When a signal is defined, and Ruby method is created to call it. Before
+ the signal methods were only being created when the Qt::MetaObject for
+ a class was created. This caused problems if the signal was emitted
+ before the Qt::MetaObject was created. Fixes problem reported for Qt3
+ QtRuby by Gadi Aleksandrowicz on the Korundum Rubyforge help forum.
2007-06-12 Richard Dale <rdale at foton.es>
--- trunk/KDE/kdebindings/ruby/qtruby/src/Qt.cpp #677125:677126
@@ -2170,7 +2170,7 @@
QMetaMethod method = metaobject->method(id);
if (method.methodType() == QMetaMethod::Signal) {
- metaobject->activate(qobj, _id, (void**) _o);
+ metaobject->activate(qobj, id, (void**) _o);
return INT2NUM(id - count);
}
--- trunk/KDE/kdebindings/ruby/qtruby/src/lib/Qt/qtruby4.rb #677125:677126
@@ -2375,15 +2375,6 @@
end
end
- def Internal.getSignalNames(klass)
- meta = Meta[klass.name] || MetaInfo.new(klass)
- signal_names = []
- meta.get_signals.each do |signal|
- signal_names.push signal.name
- end
- return signal_names
- end
-
def Internal.signalInfo(qobject, signal_name)
signals = Meta[qobject.class.name].get_signals
signals.each_with_index do |signal, i|
@@ -2518,7 +2509,6 @@
meta.slots )
meta.metaobject = make_metaObject(qobject, parentMeta, stringdata, data)
meta.changed = false
- addSignalMethods(qobject.class, getSignalNames(qobject.class))
end
meta.metaobject
@@ -2570,6 +2560,7 @@
end
def add_signals(signal_list)
+ signal_names = []
signal_list.each do |signal|
if signal.kind_of? Symbol
signal = signal.to_s + "()"
@@ -2577,10 +2568,12 @@
signal = Qt::MetaObject.normalizedSignature(signal).to_s
if signal =~ /^(([\w,<>:]*)\s+)?([^\s]*)\((.*)\)/
@signals.push QObjectMember.new($3, $3 + "(" + $4 + ")", $4, ($2 == 'void' || $2.nil?) ? "" : $2)
+ signal_names << $3
else
qWarning( "#{@klass.name}: Invalid signal format: '#{signal}'" )
end
end
+ Internal.addSignalMethods(@klass, signal_names)
end
# Return a list of signals, including inherited ones
More information about the Kde-bindings
mailing list