Skip to content

Commit

Permalink
findclasslist.pl: do match subclasses in private headers too
Browse files Browse the repository at this point in the history
I noticed that the QtCore version file had several entries for
13QObjectPrivate, which turns out to be for all the nested structs
inside. That's not harmful for QObjectPrivate, since that is itself a
private, but would be a problem for a nested struct of a public class.
I'm sure those exist.

Pick-to: 6.4
Change-Id: Ic6547f8247454b47baa8fffd170ea79360aaa615
Reviewed-by: Alexey Edelev <[email protected]>
Reviewed-by: Jörg Bornemann <[email protected]>
  • Loading branch information
thiagomacieira committed Sep 6, 2022
1 parent 5d903a6 commit ee38949
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions mkspecs/features/data/unix/findclasslist.pl
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

# Match a struct or class declaration at the top-level, but not a forward
# declaration
my $classmatch = qr/^(?:struct|class)(?:\s+Q_\w*_EXPORT)?\s+(\w+)(\s*;$)?/;
my $classmatch = qr/^(?:struct|class)(?:\s+Q_\w*_EXPORT)?\s+([\w:]+)(\s*;$)?/;

# Match an exported namespace
my $nsmatch = qr/^namespace\s+Q_\w+_EXPORT\s+(\w+)/;
my $nsmatch = qr/^namespace\s+Q_\w+_EXPORT\s+([\w:]+)/;

$\ = $/;
while (<STDIN>) {
Expand All @@ -35,7 +35,11 @@
next unless $line =~ $nsmatch or $line =~ $classmatch;
next if $2 ne ""; # forward declaration
printf " *%d%s*;\n", length $1, $1;
# split the namespace-qualified or nested class identifiers
my $sym = ($1 =~ s/:$//r); # remove trailing :
my @sym = split /::/, $sym;
@sym = map { sprintf "%d%s", length $_, $_; } @sym;
printf " *%s*;\n", join("", @sym);
$comment = 0;
}
close HDR;
Expand Down

0 comments on commit ee38949

Please sign in to comment.