[Kde-bindings] kdebindings/kalyptus

Richard Dale Richard_Dale at tipitina.demon.co.uk
Sun Jul 25 07:16:42 UTC 2004


CVS commit by rdale: 


* When the Smoke code for accessing an enum was generated, it was assuming
  that the enum was in the same source file as the class. This doesn't work
  for namespaces like KIO:: where enums can be spread over several source
  files.
* The solution is to add a source file property to each enum, and when the
  accessor code for the enum is generated a suitable include can be added.
* Fixes problem reported by Luca Perossa

CCMAIL: kde-bindings at kde.org


  M +12 -0     ChangeLog   1.53
  M +2 -1      kalyptus   1.81
  M +6 -3      kalyptusCxxToSmoke.pm   1.98


--- kdebindings/kalyptus/ChangeLog  #1.52:1.53
@@ -1,2 +1,14 @@
+2004-07-25  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
+
+        * When the Smoke code for accessing an enum was generated, it was assuming
+          that the enum was in the same source file as the class. This doesn't work
+          for namespaces like KIO:: where enums can be spread over several source
+          files.
+        * The solution is to add a source file property to each enum, and when the
+          accessor code for the enum is generated a suitable include can be added.
+        * Fixes problem reported by Luca Perossa
+
+        CCMAIL: kde-bindings at kde.org
+
 2004-07-07  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 

--- kdebindings/kalyptus/kalyptus  #1.80:1.81
@@ -1134,4 +1134,5 @@
         $node->AddProp( "NodeType", "enum" );
         $node->AddProp( "Params", $params );
+        $node->AddProp( "Source", $cSourceNode );
         makeParamList( $node, $params, 1 ); # Adds the ParamList property containing the list of param nodes
         kdocAstUtil::attachChild( $cNode, $node );

--- kdebindings/kalyptus/kalyptusCxxToSmoke.pm  #1.97:1.98
@@ -1271,7 +1271,7 @@
 
 
-sub generateEnum($$)
+sub generateEnum($$$)
 {
-    my( $classNode, $m ) = @_;  # input
+    my( $classNode, $m, $addInclude ) = @_;     # input
     my $methodCode = '';        # output
     my $switchCode = '';        # output
@@ -1280,4 +1280,7 @@
     my $className  = join( "::", @heritage );
     my $xClassName  = "x_" . join( "__", @heritage );
+    
+        my $fullEnumType = "$className\::". $m->{astNodeName};
+        checkIncludesForObject( $fullEnumType, $addInclude );
 
     foreach my $enum ( @{$m->{ParamList}} ) {
@@ -1416,5 +1419,5 @@
                                 
         if ( $methodNode->{NodeType} eq 'enum' ) {
-            my ($meth, $swit) = generateEnum( $classNode, $methodNode );
+            my ($meth, $swit) = generateEnum( $classNode, $methodNode, \%addInclude );
             $methodCode .= $meth;
             $switchCode .= $swit;





More information about the Kde-bindings mailing list