From 8e075dac8f08039957fc89d48042c8810d6ae63b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 20 Jun 2018 14:19:21 +0200 Subject: [PATCH] syncqt: make it possible to declare particular headers being private following the same mechanism as qpa headers, one can specify a list of regexes in the @private_headers variable in sync.profile. Change-Id: I5de0284e639ad283561f54dba7dda8c6437b23f8 Reviewed-by: Johan Helsing Reviewed-by: Joerg Bornemann --- bin/syncqt.pl | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/bin/syncqt.pl b/bin/syncqt.pl index 78fe0663b5f..8890b317700 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -84,7 +84,7 @@ $INPUT_RECORD_SEPARATOR = "\r\n" if ($^O eq "msys"); # will be defined based on the modules sync.profile our (%modules, %moduleheaders, @allmoduleheadersprivate, %classnames, %deprecatedheaders); -our @qpa_headers = (); +our (@qpa_headers, @private_headers); # will be derived from sync.profile our %reverse_classnames = (); @@ -659,6 +659,8 @@ sub loadSyncProfile { $reverse_classnames{$cn} = $fn; } } + + push @private_headers, qr/_p(ch)?\.h$/; } sub basePrettify { @@ -701,6 +703,15 @@ sub isQpaHeader return 0; } +sub isPrivateHeader +{ + my ($header) = @_; + foreach my $private_header (@private_headers) { + return 1 if ($header =~ $private_header); + } + return 0; +} + sub globosort($$) { my ($a, $b) = @_; if ($a =~ /^q(.*)global\.h$/) { @@ -1021,7 +1032,7 @@ foreach my $lib (@modules_to_sync) { if(isQpaHeader($public_header)) { $public_header = 0; $qpa_header = 1; - } elsif ($allheadersprivate || $thisprivate || $public_header =~ /_p(ch)?\.h$/) { + } elsif ($allheadersprivate || $thisprivate || isPrivateHeader($public_header)) { $public_header = 0; }