[Kde-bindings] KDE/kdebindings/perl/qtcore/src
Chris Michael Burel
chrisburel at gmail.com
Fri Sep 3 02:49:49 UTC 2010
SVN commit 1171223 by burel:
When calling a method in QGlobalSpace, don't stop when you find the first smoke module that provides the method you're looking for. Look through all smoke modules. This was breaking when calling operator<< on a QPixmap, because that method was defined by the QtGui module. The code would find the methods from QtCore and stop there.
I think the other bindings may want this too. I checked Ruby, and it looked incorrect to me.
CCMAIL: kde-bindings at kde.org
M +7 -4 QtCore4.xs
--- trunk/KDE/kdebindings/perl/qtcore/src/QtCore4.xs #1171222:1171223
@@ -48,21 +48,23 @@
char* classname
char* methodname
PPCODE:
- Smoke::ModuleIndex mi;
+ QList<Smoke::ModuleIndex> milist;
if ( strcmp( classname, "QGlobalSpace" ) == 0 ) {
// All modules put their global functions in "QGlobalSpace". So we
// have to use each smoke object to look for this method.
for (int i = 0; i < smokeList.size(); ++i) {
- mi = smokeList.at(i)->findMethod(classname, methodname);
+ Smoke::ModuleIndex mi = smokeList.at(i)->findMethod(classname, methodname);
if( mi.smoke ) {
- break;
+ // Found a result, add it to the return
+ milist.append(mi);
}
}
}
else {
// qtcore_Smoke will be able to find any method not in QGlobalSpace
- mi = qtcore_Smoke->findMethod(classname, methodname);
+ milist.append( qtcore_Smoke->findMethod(classname, methodname) );
}
+ foreach (Smoke::ModuleIndex mi, milist) {
if ( !mi.index ) {
// empty list
}
@@ -95,6 +97,7 @@
}
}
}
+ }
#// Args: none
#// Returns: an array of all classes that qtcore_Smoke knows about
More information about the Kde-bindings
mailing list