Skip to content

Commit

Permalink
Remove duplicated header iteration code
Browse files Browse the repository at this point in the history
Do not iterate separately over all header files. This removes
duplicated header iteration code which already was out of sync.
As a side-effect, we do run the header check only on header files that
are considered part of the module, if moduleheaders is set in
sync.profile.

Change-Id: Iec4c8febe9128139d2f377a1da8ce08c24110a77
Reviewed-by: Oswald Buddenhagen <[email protected]>
  • Loading branch information
jobor committed Nov 27, 2015
1 parent 779d2aa commit eddb938
Showing 1 changed file with 3 additions and 37 deletions.
40 changes: 3 additions & 37 deletions bin/syncqt.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,9 @@ sub isQpaHeader
my $clean_header;
my $iheader = $subdir . "/" . $header;
$iheader =~ s/^\Q$basedir\E/$out_basedir/ if ($shadow);
if ($check_includes) {
check_header($lib, $header, $iheader, $public_header, !$public_header && !$qpa_header);
}
my @classes = $public_header && (!$minimal && $is_qt) ? classNames($iheader, \$clean_header) : ();
if($showonly) {
print "$header [$lib]\n";
Expand Down Expand Up @@ -1201,41 +1204,4 @@ sub isQpaHeader
}
}

if($check_includes) {
foreach my $lib (@modules_to_sync) {
next if ($modules{$lib} =~ /^!/);
#calc subdirs
my @subdirs = listSubdirs(map { s/^\^//; $_ } split(/;/, $modules{$lib}));

foreach my $subdir (@subdirs) {
my @headers = findFiles($subdir, "^[-a-z0-9_]*\\.h\$" , 0);
foreach my $header (@headers) {
$header = 0 if($header =~ /^ui_.*.h/);
$header = 0 if ($header eq lc($lib)."version.h");
foreach (@ignore_headers) {
$header = 0 if($header eq $_);
}
if($header) {
# We need both $public_header and $private_header because QPA headers count as neither
my $public_header = $header;
my $private_header = 0;
if($public_header =~ /_p.h$/ || $public_header =~ /_pch.h$/) {
$public_header = 0;
$private_header = $header =~ /_p.h$/ && $subdir !~ /3rdparty/
} elsif (isQpaHeader($public_header)) {
$public_header = 0;
} else {
foreach (@ignore_for_master_contents) {
$public_header = 0 if($header eq $_);
}
}

my $iheader = $subdir . "/" . $header;
check_header($lib, $header, $iheader, $public_header, $private_header);
}
}
}
}
}

exit 0;

0 comments on commit eddb938

Please sign in to comment.