File indexing completed on 2024-04-21 05:41:56

0001 #!/usr/bin/perl
0002 
0003 # David Faure <faure@kde.org>
0004 # This script converts KStringHandler::*EmSqueeze/*PixelSqueeze to QFontMetrics::elidedText
0005 # Based on convert-qstringlist.
0006 
0007 use File::Basename;
0008 use lib dirname( $0 );
0009 use functionUtilkde;
0010 
0011 foreach my $file (@ARGV) {
0012     functionUtilkde::substInFile {
0013         s!KStringHandler::lEmSqueeze\s*\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)!$2.elidedText( $1, Qt::ElideLeft, $2.maxWidth() * $3 )!g;
0014         s!KStringHandler::cEmSqueeze\s*\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)!$2.elidedText( $1, Qt::ElideMiddle, $2.maxWidth() * $3 )!g;
0015         s!KStringHandler::rEmSqueeze\s*\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)!$2.elidedText( $1, Qt::ElideRight, $2.maxWidth() * $3 )!g;
0016 
0017         s!KStringHandler::lPixelSqueeze\s*\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)!$2.elidedText( $1, Qt::ElideLeft, $3 )!g;
0018         s!KStringHandler::cPixelSqueeze\s*\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)!$2.elidedText( $1, Qt::ElideMiddle, $3 )!g;
0019         s!KStringHandler::rPixelSqueeze\s*\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)!$2.elidedText( $1, Qt::ElideRight, $3 )!g;
0020 
0021     } $file;
0022     functionUtilkde::removeIncludeInFile( $file, "kstringhandler.h");
0023 }
0024 functionUtilkde::diffFile( @ARGV );