File indexing completed on 2024-04-14 05:35:06

0001 #!/usr/bin/perl -w
0002 
0003 # Laurent Montel <montel@kde.org> (2014)
0004 # KSplashScreen => QSplashScreen
0005 # find -iname "*.cpp" -o -iname "*.h" |xargs kde-dev-scripts/kf5/convert-ksplashscreen.pl
0006 
0007 use strict;
0008 use File::Basename;
0009 use lib dirname($0);
0010 use functionUtilkde;
0011 
0012 foreach my $file (@ARGV) {
0013 
0014     my $modified;
0015     open(my $FILE, "<", $file) or warn "We can't open file $file:$!\n";
0016     my @l = map {
0017         my $orig = $_;
0018         s/\bKSplashScreen\b/QSplashScreen/g;
0019         s/\<KSplashScreen\b\>/\<QSplashScreen>/ =~ /#include/ ;
0020         s/\<ksplashscreen.h\>/\<QSplashScreen>/ =~ /#include/ ;
0021 
0022         $modified ||= $orig ne $_;
0023         $_;
0024     } <$FILE>;
0025 
0026     if ($modified) {
0027         open (my $OUT, ">", $file);
0028         print $OUT @l;
0029         close ($OUT);
0030     }
0031 }
0032 
0033 functionUtilkde::diffFile( "@ARGV" );