3
# laurent Montel <montel@kde.org> 2005
4
# This script will remove some QT3_SUPPORT into qstring/qdir/qtimer/qglobal
11
open(my $F, q(find -name "*" |));
13
while ($file = <$F>) {
15
next if functionUtilkde::excludeFile( $file);
16
open(my $FILE, $file) or warn "We can't open file $file:$!\n";
20
if ( $_ =~ /lastIndexOf/ ) {
22
my ($before, $prefix, $contenu) = m!^(\s*.*)(lastIndexOf.*)\((.*)\s*\);$!;
23
if ( my ($firstelement, $secondelement, $thirdelement) = m!.*?\(\s*(.*),\s*(.*),\s*(.*)\);\s*$!) {
24
$thirdelement =~ s/ //g;
25
if ( $thirdelement =~ /true/ ) {
26
$_ = $before . "lastIndexOf( $firstelement, $secondelement, Qt::CaseSensitive );\n";
28
elsif ( $thirdelement =~ /false/ ) {
29
$_ = $before . "lastIndexOf( $firstelement, $secondelement, Qt::CaseInsensitive );\n";
32
s/lastIndexOf/lastIndexOf/;
36
s/lastIndexOf/lastIndexOf/;
39
s!toLocal8Bit!toLocal8Bit!g;
40
if( $_ =~ /\.toUtf8/ ) {
41
s!\.toUtf8!\.toUtf8!g;
43
if( $_ =~ /\.hasMirrored/ ) {
44
s!mirrored!hasMirrored!g;
46
if( $_ =~ /absPath\s*\(\s*\)/ ) {
47
s!absPath!absolutePath!;
49
if ( $_ =~ /\.latin1\s*\(\s*\)/ ) {
50
s!\.latin1!\.toLatin1!g;
52
if ( $_ =~ /\.xForm\s*\(/ ) {
53
s!\.xForm!\.transformed!;
55
if ( $_ =~ /->xForm\s*\(/ ) {
56
s!\->xForm!\->transformed!;
60
s!isSequentialAccess!isSequential!;
62
s!QComboBox::Policy!QComboBox::InsertPolicy!g;
63
s!insertionPolicy!insertPolicy!;
64
s!setInsertionPolicy!setInsertPolicy!;
65
s!NoInsertion!NoInsert!;
67
if ( $_ =~ /\.lower\s*\(\s*\)/ ) {
68
s!\.lower!\.toLower!g;
70
if ( $_ =~ /\.upper\s*\(\s*\)/ ) {
71
s!\.upper!\.toUpper!g;
73
if( $_ =~ /dirPath/ ) {
74
if( my ($before, $prefix, $contenu, $after ) = m!^(\s*.*)(dirPath.*?\()(.*?\))(.*)$!) {
77
if( $contenu =~ /true|TRUE/ ) {
78
$_ = $before . "absolutePath()" . $after . "\n";
80
elsif ( $contenu =~ /false|FALSE/ ) {
81
$_ = $before . "path()" . $after . "\n";
83
elsif ($contenu eq "" ) {
84
$_ = $before . "path()" . $after . "\n";
87
warn "Verify if we can port or not : <$contenu> \n";
92
s!QApplication::reverseLayout!QApplication::isRightToLeft!;
94
s!Qt::ShiftButton!Qt::ShiftModifier!;
95
s!Qt::ControlButton!Qt::ControlModifier!;
96
s!Qt::AltButton!Qt::AltModifier!;
97
s!Qt::MetaButton!Qt::MetaModifier!;
98
s!Qt::Keypad!Qt::KeypadModifier!;
99
s!Qt::KeyButtonMask!Qt::KeyboardModifierMask!;
100
s!convertToAbs!makeAbsolute!;
101
s!currentDirPath!currentPath!;
102
s!homeDirPath!homePath!;
103
s!rootDirPath!rootPath!;
104
s!cleanDirPath!cleanPath!;
105
s!absFilePath!absoluteFilePath!;
106
s!QDir::All!QDir::TypeMask!;
107
s!QDir::DefaultFilter!QDir::NoFilter!;
108
s!QDir::DefaultSort!QDir::NoSort!;
109
s!simplifyWhiteSpace!simplified!g;
110
s!stripWhiteSpace!trimmed!g;
112
s!leftJustify!leftJustified!g;
113
s!rightJustify!rightJustified!g;
114
s!fromUcs2!fromUtf16!g;
116
s!changeInterval!start!g;
122
s!Q_UINT16!quint16!g;
124
s!Q_UINT32!quint32!g;
126
s!Q_UINT64!quint64!g;
128
s!Q_ULLONG!quint64!g;
131
s!Qt::ScaleMin!Qt::KeepAspectRatio!g;
132
s!Qt::ScaleMax!Qt::KeepAspectRatioByExpanding!g;
133
s!Qt::ScaleFree!Qt::IgnoreAspectRatio!g;
134
s!Qt::AlignAuto!Qt::AlignLeft!g;
135
s!Qt::CustomPattern!Qt::TexturePattern!g;
136
if( $_ =~ /Qt::TopLeft/ ) {
137
s!Qt::TopLeft!Qt::TopLeftCorner!g if( $_ !~ /Qt::TopLeftCorner/ );
139
if( $_ =~ /Qt::TopRight/ ) {
140
s/Qt::TopRight/Qt::TopRightCorner/g if( $_ !~ /Qt::TopRightCorner/ );
142
if( $_ =~ /Qt::BottomLeft/ ) {
143
s/Qt::BottomLeft/Qt::BottomLeftCorner/g if( $_ !~ /Qt::BottomLeftCorner/);
145
if( $_ =~ /Qt::BottomRight/ ) {
146
s/Qt::BottomRight/Qt::BottomRightCorner/g if( $_ !~ /Qt::BottomRightCorner/ );
155
s!draggingSlider!isSliderDown!;
157
s!setTabIconSet!setTabIcon!;
158
s!tabIconSet!tabIcon!;
160
$modified ||= $orig ne $_;
164
open (my $OUT, ">$file");
169
functionUtilkde::diffFile( "@ARGV" );