summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2018-06-20 14:19:21 +0200
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2018-06-25 09:48:37 +0000
commit8e075dac8f08039957fc89d48042c8810d6ae63b (patch)
tree31c1d2b85864c41b1c9eaae69808466ee1fa218c /bin
parent372b5504fd766470dc9fddd05b07adfc99b7faa3 (diff)
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 <johan.helsing@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/syncqt.pl15
1 files changed, 13 insertions, 2 deletions
diff --git a/bin/syncqt.pl b/bin/syncqt.pl
index 78fe0663b5..8890b31770 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;
}