[Kde-bindings] KDE/kdebindings/kalyptus

Richard Dale Richard_Dale at tipitina.demon.co.uk
Wed Apr 30 09:16:37 UTC 2008


SVN commit 802667 by rdale:

* Add a hack so the classes such as KCoreConfigSkeleton::ItemBool are considered
  to be direct descendents of KConfigSkeletonItem, although their real parent is
  the template class KConfigSkeletonGenericItem. This makes it possible to use
  methods like isImmutable() from KConfigSkeletonItem.

CCMAIL: kde-bindings at kde.org

 M  +26 -18    kalyptusCxxToSmoke.pm  


--- trunk/KDE/kdebindings/kalyptus/kalyptusCxxToSmoke.pm #802666:802667
@@ -2026,35 +2026,43 @@
 	# Make list of direct ancestors
 	my @super;
 	Iter::Ancestors( $classNode, $rootnode, undef, undef, sub {
-			     my $superClassName = join( "::", kdocAstUtil::heritage($_[0]) );
-			     push @super, $superClassName;
+				my $superClassName = join( "::", kdocAstUtil::heritage($_[0]) );
+				push @super, $superClassName;
+
+				# If the immediate parent is a template class and won't have a class index, 
+				# then have a look at its parent
+				if ( exists $_[0]->{Tmpl} && defined $_[0]->{InList}[0] ) {
+					$superClassName = join( "::", kdocAstUtil::heritage($_[0]->{InList}[0]) );
+					push @super, $superClassName;
+				}
 		    }, undef );
 	# Turn that into a list of class indexes
 	my $key = '';
 	foreach my $superClass( @super ) {
-	    if (defined $classidx{$superClass}) {
-		$key .= ', ' if ( length $key > 0 );
-		$key .= $classidx{$superClass};
+		if (defined $classidx{$superClass}) {
+			$key .= ', ' if ( length $key > 0 );
+			$key .= $classidx{$superClass};
 	    }
 	}
+
 	if ( $key ne '' ) {
-	    if ( !defined $inheritfinder{$key} ) {
-		print OUT "\t";
-		my $index = $inheritlistsize; # Index of first entry (for this group) in inheritlist
-		foreach my $superClass( @super ) {
-		    if (defined $classidx{$superClass}) {
-			print OUT "$classidx{$superClass}, ";
+		if ( !defined $inheritfinder{$key} ) {
+			print OUT "\t";
+			my $index = $inheritlistsize; # Index of first entry (for this group) in inheritlist
+			foreach my $superClass( @super ) {
+				if (defined $classidx{$superClass}) {
+					print OUT "$classidx{$superClass}, ";
+					$inheritlistsize++;
+		    	}
+			}
 			$inheritlistsize++;
-		    }
+			my $comment = join( ", ", @super );
+			print OUT "0,\t// $index: $comment\n";
+			$inheritfinder{$key} = $index;
 		}
-		$inheritlistsize++;
-		my $comment = join( ", ", @super );
-		print OUT "0,\t// $index: $comment\n";
-		$inheritfinder{$key} = $index;
-	    }
 	    $classinherit{$className} = $inheritfinder{$key};
 	} else { # No superclass
-	    $classinherit{$className} = 0;
+		$classinherit{$className} = 0;
 	}
     } );
     print OUT "};\n\n";



More information about the Kde-bindings mailing list