[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebindings/kalyptus
From:       Richard Dale <Richard_Dale () tipitina ! demon ! co ! uk>
Date:       2004-07-25 7:16:42
Message-ID: 20040725071642.51F9C12661 () office ! kde ! org
[Download RAW message or body]

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@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@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@kde.org
+
 2004-07-07  Richard Dale  <Richard_Dale@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;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic