[Kde-bindings] KDE/kdebindings

Arno Rehn kde at arnorehn.de
Wed Nov 25 19:10:32 UTC 2009


SVN commit 1054240 by arnorehn:

Add mf_virtual and mf_purevirtual method flags to SMOKE and make generator
flag the methods accordingly.

CCMAIL: kde-bindings at kde.org



 M  +10 -0     generator/generators/smoke/writeSmokeDataFile.cpp  
 M  +3 -1      smoke/smoke.h  


--- trunk/KDE/kdebindings/generator/generators/smoke/writeSmokeDataFile.cpp #1054239:1054240
@@ -451,6 +451,8 @@
         if (isExternal && !declaredVirtualMethods.contains(klass))
             continue;
         
+        QList<const Method*> virtualMethods = Util::virtualMethodsForClass(klass);
+        
         int xcall_index = 1;
         foreach (const Method& meth, klass->methods()) {
             if (isExternal && !declaredVirtualMethods[klass].contains(&meth))
@@ -486,6 +488,14 @@
                 flags += "|Smoke::mf_attribute";
             if (meth.isQPropertyAccessor())
                 flags += "|Smoke::mf_property";
+            
+            // Simply checking for flags() & Method::Virtual won't be enough, because methods can override virtuals without being
+            // declared 'virtual' themselves (and they're still virtual, then).
+            if (virtualMethods.contains(&meth))
+                flags += "|Smoke::mf_virtual";
+            if (meth.flags() & Method::PureVirtual)
+                flags += "|Smoke::mf_purevirtual";
+            
             flags.replace("0|", "");
             out << flags;
             if (meth.type() == Type::Void) {
--- trunk/KDE/kdebindings/smoke/smoke.h #1054239:1054240
@@ -131,7 +131,9 @@
         mf_dtor = 0x40,
         mf_protected = 0x80,
         mf_attribute = 0x100,
-        mf_property = 0x200
+        mf_property = 0x200,
+        mf_virtual = 0x400,
+        mf_purevirtual = 0x800
     };
     /**
      * Describe one method of one class.



More information about the Kde-bindings mailing list