File: convert-qstringlatin1.pl

package info (click to toggle)
kde-dev-scripts 4%3A18.08.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,496 kB
  • sloc: perl: 15,466; lisp: 5,627; sh: 4,157; python: 3,892; ruby: 2,158; makefile: 16; sed: 9
file content (20 lines) | stat: -rwxr-xr-x 640 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/perl

# laurent Montel <montel@kde.org>
# This function convert QLatin1String instead of QString::fromLatin1()
# see "qlatin1string.html" "is faster than converting the Latin-1 strings using QString::fromLatin1()." 
# TODO: test "QString::fromLatin1(blabla())"
#
use File::Basename;
use lib dirname($0);
use functionUtilkde;

foreach my $file (@ARGV) {
    functionUtilkde::substInFile { 
			if( my ($prefix, $suite, $end) = /(.*)(QString::fromLatin1.*?\))(.*$)/) {
				s!QString::fromLatin1!QLatin1String! if $end !~ /(\.arg|\.mid|\.prepend|\.append|\.toLower|\.upper)/;
			}
    } $file;
}
functionUtilkde::diffFile( @ARGV );