From 7fb5a8dec9f5103c63d6cd40848f41e9e6565795 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 1 Sep 2011 14:37:46 -0500 Subject: [PATCH] Fix Qt3-->TQt3 conversion scripts --- qt3-tqt3/convert_qt_itself_qt3 | 7 +++ qt3-tqt3/tqt3_fixups.diff | 106 +++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+) diff --git a/qt3-tqt3/convert_qt_itself_qt3 b/qt3-tqt3/convert_qt_itself_qt3 index f12e1d7..1cfdc98 100755 --- a/qt3-tqt3/convert_qt_itself_qt3 +++ b/qt3-tqt3/convert_qt_itself_qt3 @@ -2,12 +2,15 @@ find ./ -type f -iname "*.c*" -exec sed -i 's/^Q\([ABCDEFGHIJKLMNOPQRSTUVWXYZ]\)\([_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]\)/TQ\1\2/g' {} \; find ./ -type f -iname "*.h*" -exec sed -i 's/^Q\([ABCDEFGHIJKLMNOPQRSTUVWXYZ]\)\([_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]\)/TQ\1\2/g' {} \; +find ./ -type f -iname "*.ui*" -exec sed -i 's/^Q\([ABCDEFGHIJKLMNOPQRSTUVWXYZ]\)\([_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]\)/TQ\1\2/g' {} \; find ./ -type f -iname "*.c*" -exec sed -i 's/\([^_]\)Q\([ABCDEFGHIJKLMNOPQRSTUVWXYZ]\)\([_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]\)/\1TQ\2\3/g' {} \; find ./ -type f -iname "*.h*" -exec sed -i 's/\([^_]\)Q\([ABCDEFGHIJKLMNOPQRSTUVWXYZ]\)\([_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]\)/\1TQ\2\3/g' {} \; +find ./ -type f -iname "*.ui*" -exec sed -i 's/\([^_]\)Q\([ABCDEFGHIJKLMNOPQRSTUVWXYZ]\)\([_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]\)/\1TQ\2\3/g' {} \; find ./ -type f -iname "*.c*" -exec sed -i 's/Qt/TQt/g' {} \; find ./ -type f -iname "*.h*" -exec sed -i 's/Qt/TQt/g' {} \; +find ./ -type f -iname "*.ui*" -exec sed -i 's/Qt/TQt/g' {} \; find ./ -type f -iname "*.h*" -exec sed -i 's/TTQ/TQ/g' {} \; find ./ -type f -iname "*.h*" -exec sed -i 's/TTQ/TQ/g' {} \; @@ -17,6 +20,10 @@ find ./ -type f -iname "*.c*" -exec sed -i 's/TTQ/TQ/g' {} \; find ./ -type f -iname "*.c*" -exec sed -i 's/TTQ/TQ/g' {} \; find ./ -type f -iname "*.c*" -exec sed -i 's/TTQ/TQ/g' {} \; find ./ -type f -iname "*.c*" -exec sed -i 's/TTQ/TQ/g' {} \; +find ./ -type f -iname "*.ui*" -exec sed -i 's/TTQ/TQ/g' {} \; +find ./ -type f -iname "*.ui*" -exec sed -i 's/TTQ/TQ/g' {} \; +find ./ -type f -iname "*.ui*" -exec sed -i 's/TTQ/TQ/g' {} \; +find ./ -type f -iname "*.ui*" -exec sed -i 's/TTQ/TQ/g' {} \; sed -i 's/^Q\([ABCDEFGHIJKLMNOPQRSTUVWXYZ]\)\([_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]\)/TQ\1\2/g' src/moc/moc.l sed -i 's/^Q\([ABCDEFGHIJKLMNOPQRSTUVWXYZ]\)\([_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]\)/TQ\1\2/g' src/moc/moc.y diff --git a/qt3-tqt3/tqt3_fixups.diff b/qt3-tqt3/tqt3_fixups.diff index 2f12550..229e638 100644 --- a/qt3-tqt3/tqt3_fixups.diff +++ b/qt3-tqt3/tqt3_fixups.diff @@ -26,3 +26,109 @@ diff -ur src/moc/moc_yacc.cpp src/moc/moc_yacc.cpp else type[0] = toupper( type[0] ); fprintf( out, "v->as%s()", type.data() ); +diff -ur tools/designer/designer/mainwindowactions.cpp tools/designer/designer/mainwindowactions.cpp +--- tools/designer/designer/mainwindowactions.cpp 2011-08-30 16:14:24.000000000 -0500 ++++ tools/designer/designer/mainwindowactions.cpp 2011-08-30 17:06:52.000000000 -0500 +@@ -539,8 +539,8 @@ + new WidgetAction( grp, actionGroupTools, TQString::number( i ).latin1() ); + a->setToggleAction( TRUE ); + TQString atext = WidgetDatabase::className( i ); +- if ( atext[0] == 'Q' ) +- atext = atext.mid(1); ++ if (( atext[0] == 'T' ) && ( atext[1] == 'Q' )) ++ atext = atext.mid(2); + while ( atext.length() && atext[0] >= 'a' && atext[0] <= 'z' ) + atext = atext.mid(1); + if ( atext.isEmpty() ) +diff -ur tools/designer/plugins/dlg/dlg2ui.cpp tools/designer/plugins/dlg/dlg2ui.cpp +--- tools/designer/plugins/dlg/dlg2ui.cpp 2011-08-30 16:14:25.000000000 -0500 ++++ tools/designer/plugins/dlg/dlg2ui.cpp 2011-08-30 17:07:13.000000000 -0500 +@@ -382,7 +382,7 @@ + } else if ( e.tagName() == TQString("DlgWidget") ) { + return TQString( "TQWidget" ); + } else { +- return TQChar( 'Q' ) + e.tagName(); ++ return TQString( "TQ" ).append( e.tagName() ); + } + } + +diff -ur tools/designer/tools/createcw/main.cpp tools/designer/tools/createcw/main.cpp +--- tools/designer/tools/createcw/main.cpp 2011-08-30 16:14:24.000000000 -0500 ++++ tools/designer/tools/createcw/main.cpp 2011-08-30 17:05:45.000000000 -0500 +@@ -76,8 +76,8 @@ + static TQString convert_type( const TQString &s ) + { + TQString str( s ); +- if ( str[ 0 ] == 'Q' ) +- str.remove( 0, 1 ); ++ if (( str[ 0 ] == 'T' ) && ( str[ 1 ] == 'Q' )) ++ str.remove( 0, 2 ); + str[ 0 ] = str[ 0 ].upper(); + return str; + } +diff -ur tools/designer/uic/object.cpp tools/designer/uic/object.cpp +--- tools/designer/uic/object.cpp 2011-08-30 16:14:24.000000000 -0500 ++++ tools/designer/uic/object.cpp 2011-08-30 17:05:16.000000000 -0500 +@@ -116,8 +116,8 @@ + TQString definedName = objName; + bool isTmpObject = objName.isEmpty() || objClass == "TQLayoutWidget"; + if ( isTmpObject ) { +- if ( objClass[0] == 'Q' ) +- objName = objClass.mid(1); ++ if (( objClass[0] == 'T' ) && ( objClass[1] == 'Q' )) ++ objName = objClass.mid(2); + else + objName = objClass.lower(); + objName.prepend( "private" ); +diff -ur tools/designer/shared/widgetdatabase.cpp tools/designer/shared/widgetdatabase.cpp +--- tools/designer/shared/widgetdatabase.cpp ++++ tools/designer/shared/widgetdatabase.cpp +@@ -719,8 +719,12 @@ + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return TQString::null; +- if ( r->includeFile.isNull() ) +- return r->name.lower() + ".h"; ++ if ( r->includeFile.isNull() ) { ++ TQString rq = r->name; ++ if ( rq[ 0 ] == 'T' && rq[ 1 ] == 'Q') ++ rq = rq.mid(1); ++ return rq.lower() + ".h"; ++ } + return r->includeFile; + } + +@@ -762,8 +766,8 @@ + TQString n = className( id ); + if ( n == "TQLayoutWidget" ) + n = "Layout"; +- if ( n[ 0 ] == 'Q' && n[ 1 ].lower() != n[ 1 ] ) +- n = n.mid( 1 ); ++ if ( n[ 0 ] == 'T' && n[ 1 ] == 'Q' && n[ 2 ].lower() != n[ 2 ] ) ++ n = n.mid( 2 ); + int colonColon = n.findRev( "::" ); + if ( colonColon != -1 ) + n = n.mid( colonColon + 2 ); +diff -ur tools/designer/uic/form.cpp tools/designer/uic/form.cpp +--- tools/designer/uic/form.cpp ++++ tools/designer/uic/form.cpp +@@ -294,8 +294,8 @@ + s = "TQFrame"; + if ( !(nofwd && customWidgets.contains(s)) ) + forwardDecl += s; +- if ( s.mid( 1 ) == "ListBox" || s.mid( 1 ) == "ListView" || s.mid( 1 ) == "IconView" ) +- forwardDecl += "Q" + s.mid( 1 ) + "Item"; ++ if ( s.mid( 2 ) == "ListBox" || s.mid( 2 ) == "ListView" || s.mid( 2 ) == "IconView" ) ++ forwardDecl += "TQ" + s.mid( 2 ) + "Item"; + if ( s == "TQDataTable" ) { // other convenience classes which are used in TQDataTable signals, and thus should be forward-declared by uic for us + forwardDecl += "TQSqlRecord"; + } +@@ -807,7 +807,7 @@ + globalIncludes += "qapplication.h"; + continue; + } +- if ( name.mid( 1 ) == "ListView" ) ++ if ( name.mid( 2 ) == "ListView" ) + globalIncludes += "qheader.h"; + if ( name != objClass ) { + int wid = WidgetDatabase::idFromClassName( name );