summaryrefslogtreecommitdiffstats
path: root/python/pyqt/pylupdate3
diff options
context:
space:
mode:
Diffstat (limited to 'python/pyqt/pylupdate3')
-rw-r--r--python/pyqt/pylupdate3/fetchtr.cpp46
-rw-r--r--python/pyqt/pylupdate3/main.cpp38
-rw-r--r--python/pyqt/pylupdate3/merge.cpp6
-rw-r--r--python/pyqt/pylupdate3/metatranslator.cpp194
-rw-r--r--python/pyqt/pylupdate3/metatranslator.h30
-rw-r--r--python/pyqt/pylupdate3/numberh.cpp38
-rw-r--r--python/pyqt/pylupdate3/proparser.cpp46
-rw-r--r--python/pyqt/pylupdate3/proparser.h6
-rw-r--r--python/pyqt/pylupdate3/sametexth.cpp12
9 files changed, 208 insertions, 208 deletions
diff --git a/python/pyqt/pylupdate3/fetchtr.cpp b/python/pyqt/pylupdate3/fetchtr.cpp
index 609dbc18..600b3a07 100644
--- a/python/pyqt/pylupdate3/fetchtr.cpp
+++ b/python/pyqt/pylupdate3/fetchtr.cpp
@@ -29,23 +29,23 @@
**
**********************************************************************/
-#include <qfile.h>
-#include <qregexp.h>
-#include <qstring.h>
-#include <qtextstream.h>
+#include <tqfile.h>
+#include <tqregexp.h>
+#include <tqstring.h>
+#include <tqtextstream.h>
#include <ctype.h>
#include <errno.h>
#include <metatranslator.h>
#include <stdio.h>
#include <string.h>
-/*#include <qxml.h>*/
+/*#include <tqxml.h>*/
static const char MagicComment[] = "TRANSLATOR ";
-static QMap<QCString, int> needs_Q_OBJECT;
-static QMap<QCString, int> lacks_Q_OBJECT;
+static TQMap<TQCString, int> needs_Q_OBJECT;
+static TQMap<TQCString, int> lacks_Q_OBJECT;
/*
The first part of this source file is the python tokenizer. We skip
@@ -62,7 +62,7 @@ enum { Tok_Eof, Tok_class, Tok_return, Tok_tr,
The tokenizer maintains the following global variables. The names
should be self-explanatory.
*/
-static QCString yyFileName;
+static TQCString yyFileName;
static int yyCh;
static char yyIdent[128];
static size_t yyIdentLen;
@@ -78,7 +78,7 @@ static int yyCurLineNo;
static FILE *yyInFile;
// the string to read from and current position in the string (otherwise)
-static QString yyInStr;
+static TQString yyInStr;
static int yyInPos;
static int buf;
@@ -225,7 +225,7 @@ static int getToken()
yyCh = getChar();
if ( yyCh == 'x' ) {
- QCString hex = "0";
+ TQCString hex = "0";
yyCh = getChar();
while ( isxdigit(yyCh) ) {
@@ -236,7 +236,7 @@ static int getToken()
if ( yyStringLen < sizeof(yyString) - 1 )
yyString[yyStringLen++] = (char) n;
} else if ( yyCh >= '0' && yyCh < '8' ) {
- QCString oct = "";
+ TQCString oct = "";
do {
oct += (char) yyCh;
@@ -316,7 +316,7 @@ static bool match( int t )
return matches;
}
-static bool matchString( QCString *s )
+static bool matchString( TQCString *s )
{
bool matches = ( yyTok == Tok_String );
*s = "";
@@ -330,10 +330,10 @@ static bool matchString( QCString *s )
static bool matchEncoding( bool *utf8 )
{
if ( yyTok == Tok_Ident ) {
- if ( strcmp(yyIdent, "QApplication") == 0 ) {
+ if ( strcmp(yyIdent, "TQApplication") == 0 ) {
yyTok = getToken();
}
- *utf8 = QString( yyIdent ).endsWith( QString("UTF8") );
+ *utf8 = TQString( yyIdent ).endsWith( TQString("UTF8") );
yyTok = getToken();
return TRUE;
} else {
@@ -344,12 +344,12 @@ static bool matchEncoding( bool *utf8 )
static void parse( MetaTranslator *tor, const char *initialContext,
const char *defaultContext )
{
- QMap<QCString, QCString> qualifiedContexts;
- QCString context;
- QCString text;
- QCString com;
- QCString functionContext = initialContext;
- QCString prefix;
+ TQMap<TQCString, TQCString> qualifiedContexts;
+ TQCString context;
+ TQCString text;
+ TQCString com;
+ TQCString functionContext = initialContext;
+ TQCString prefix;
bool utf8 = FALSE;
yyTok = getToken();
@@ -380,7 +380,7 @@ static void parse( MetaTranslator *tor, const char *initialContext,
if ( qualifiedContexts.contains(context) )
context = qualifiedContexts[context];
tor->insert( MetaTranslatorMessage(context, text, com,
- QString::null, utf8) );
+ TQString::null, utf8) );
}
}
break;
@@ -400,7 +400,7 @@ static void parse( MetaTranslator *tor, const char *initialContext,
matchEncoding(&utf8) &&
match(Tok_RightParen))) )
tor->insert( MetaTranslatorMessage(context, text, com,
- QString::null, utf8) );
+ TQString::null, utf8) );
}
break;
case Tok_Ident:
@@ -423,7 +423,7 @@ static void parse( MetaTranslator *tor, const char *initialContext,
context = com.left( k );
com.remove( 0, k + 1 );
tor->insert( MetaTranslatorMessage(context, "", com,
- QString::null, FALSE) );
+ TQString::null, FALSE) );
}
}
yyTok = getToken();
diff --git a/python/pyqt/pylupdate3/main.cpp b/python/pyqt/pylupdate3/main.cpp
index 427fed51..bd3d7612 100644
--- a/python/pyqt/pylupdate3/main.cpp
+++ b/python/pyqt/pylupdate3/main.cpp
@@ -29,10 +29,10 @@
**
**********************************************************************/
-#include <qfile.h>
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qtextstream.h>
+#include <tqfile.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqtextstream.h>
#include <errno.h>
#include <metatranslator.h>
@@ -47,7 +47,7 @@ extern void fetchtr_py( const char *fileName, MetaTranslator *tor,
extern void merge( MetaTranslator *tor, const MetaTranslator *virginTor,
bool verbose );
-typedef QValueList<MetaTranslatorMessage> TML;
+typedef TQValueList<MetaTranslatorMessage> TML;
static void printUsage()
{
@@ -85,39 +85,39 @@ int main( int argc, char **argv )
}
numProFiles++;
- QFile f( argv[i] );
+ TQFile f( argv[i] );
if ( !f.open(IO_ReadOnly) ) {
qWarning( "pylupdate error: Cannot open project file '%s': %s",
argv[i], strerror(errno) );
return 1;
}
- QTextStream t( &f );
- QString fullText = t.read();
+ TQTextStream t( &f );
+ TQString fullText = t.read();
f.close();
MetaTranslator fetchedTor;
- QString defaultContext = "@default";
- QCString codec;
- QStringList translatorFiles;
- QStringList::Iterator tf;
+ TQString defaultContext = "@default";
+ TQCString codec;
+ TQStringList translatorFiles;
+ TQStringList::Iterator tf;
- QMap<QString, QString> tagMap = proFileTagMap( fullText );
- QMap<QString, QString>::Iterator it;
+ TQMap<TQString, TQString> tagMap = proFileTagMap( fullText );
+ TQMap<TQString, TQString>::Iterator it;
for ( it = tagMap.begin(); it != tagMap.end(); ++it ) {
- QStringList toks = QStringList::split( QChar(' '), it.data() );
- QStringList::Iterator t;
+ TQStringList toks = TQStringList::split( TQChar(' '), it.data() );
+ TQStringList::Iterator t;
for ( t = toks.begin(); t != toks.end(); ++t ) {
- if ( it.key() == QString("SOURCES") ) {
+ if ( it.key() == TQString("SOURCES") ) {
fetchtr_py( *t, &fetchedTor,
defaultContext, TRUE );
metSomething = TRUE;
- } else if ( it.key() == QString("TRANSLATIONS") ) {
+ } else if ( it.key() == TQString("TRANSLATIONS") ) {
translatorFiles.append( *t );
metSomething = TRUE;
- } else if ( it.key() == QString("CODEC") ) {
+ } else if ( it.key() == TQString("CODEC") ) {
codec = (*t).latin1();
}
}
diff --git a/python/pyqt/pylupdate3/merge.cpp b/python/pyqt/pylupdate3/merge.cpp
index c569c938..6ae9673d 100644
--- a/python/pyqt/pylupdate3/merge.cpp
+++ b/python/pyqt/pylupdate3/merge.cpp
@@ -21,7 +21,7 @@ extern void applyNumberHeuristic( MetaTranslator *tor, bool verbose );
// defined in sametexth.cpp
extern void applySameTextHeuristic( MetaTranslator *tor, bool verbose );
-typedef QValueList<MetaTranslatorMessage> TML;
+typedef TQValueList<MetaTranslatorMessage> TML;
/*
Merges two MetaTranslator objects into the first one. The first one is a set
@@ -47,7 +47,7 @@ void merge( MetaTranslator *tor, const MetaTranslator *virginTor, bool verbose )
MetaTranslatorMessage m = *it;
// skip context comment
- if ( !QCString((*it).sourceText()).isEmpty() ) {
+ if ( !TQCString((*it).sourceText()).isEmpty() ) {
if ( !virginTor->contains((*it).context(), (*it).sourceText(),
(*it).comment()) ) {
newType = MetaTranslatorMessage::Obsolete;
@@ -86,7 +86,7 @@ void merge( MetaTranslator *tor, const MetaTranslator *virginTor, bool verbose )
if ( !tor->contains((*it).context(), (*it).sourceText(),
(*it).comment()) ) {
tor->insert( *it );
- if ( !QCString((*it).sourceText()).isEmpty() )
+ if ( !TQCString((*it).sourceText()).isEmpty() )
neww++;
}
}
diff --git a/python/pyqt/pylupdate3/metatranslator.cpp b/python/pyqt/pylupdate3/metatranslator.cpp
index c3d06738..24a23f4b 100644
--- a/python/pyqt/pylupdate3/metatranslator.cpp
+++ b/python/pyqt/pylupdate3/metatranslator.cpp
@@ -14,25 +14,25 @@
**
**********************************************************************/
-#include <qapplication.h>
-#include <qcstring.h>
-#include <qfile.h>
-#include <qmessagebox.h>
-#include <qregexp.h>
-#include <qtextcodec.h>
-#include <qtextstream.h>
-#include <qxml.h>
+#include <tqapplication.h>
+#include <tqcstring.h>
+#include <tqfile.h>
+#include <tqmessagebox.h>
+#include <tqregexp.h>
+#include <tqtextcodec.h>
+#include <tqtextstream.h>
+#include <tqxml.h>
#include "metatranslator.h"
-static bool encodingIsUtf8( const QXmlAttributes& atts )
+static bool encodingIsUtf8( const TQXmlAttributes& atts )
{
for ( int i = 0; i < atts.length(); i++ ) {
// utf8="true" is a pre-3.0 syntax
- if ( atts.qName(i) == QString("utf8") ) {
- return ( atts.value(i) == QString("true") );
- } else if ( atts.qName(i) == QString("encoding") ) {
- return ( atts.value(i) == QString("UTF-8") );
+ if ( atts.qName(i) == TQString("utf8") ) {
+ return ( atts.value(i) == TQString("true") );
+ } else if ( atts.qName(i) == TQString("encoding") ) {
+ return ( atts.value(i) == TQString("UTF-8") );
}
}
return FALSE;
@@ -46,38 +46,38 @@ public:
inMessage( FALSE ), ferrorCount( 0 ), contextIsUtf8( FALSE ),
messageIsUtf8( FALSE ) { }
- virtual bool startElement( const QString& namespaceURI,
- const QString& localName, const QString& qName,
- const QXmlAttributes& atts );
- virtual bool endElement( const QString& namespaceURI,
- const QString& localName, const QString& qName );
- virtual bool characters( const QString& ch );
- virtual bool fatalError( const QXmlParseException& exception );
+ virtual bool startElement( const TQString& namespaceURI,
+ const TQString& localName, const TQString& qName,
+ const TQXmlAttributes& atts );
+ virtual bool endElement( const TQString& namespaceURI,
+ const TQString& localName, const TQString& qName );
+ virtual bool characters( const TQString& ch );
+ virtual bool fatalError( const TQXmlParseException& exception );
private:
MetaTranslator *tor;
MetaTranslatorMessage::Type type;
bool inMessage;
- QString context;
- QString source;
- QString comment;
- QString translation;
+ TQString context;
+ TQString source;
+ TQString comment;
+ TQString translation;
- QString accum;
+ TQString accum;
int ferrorCount;
bool contextIsUtf8;
bool messageIsUtf8;
};
-bool TsHandler::startElement( const QString& /* namespaceURI */,
- const QString& /* localName */,
- const QString& qName,
- const QXmlAttributes& atts )
+bool TsHandler::startElement( const TQString& /* namespaceURI */,
+ const TQString& /* localName */,
+ const TQString& qName,
+ const TQXmlAttributes& atts )
{
- if ( qName == QString("byte") ) {
+ if ( qName == TQString("byte") ) {
for ( int i = 0; i < atts.length(); i++ ) {
- if ( atts.qName(i) == QString("value") ) {
- QString value = atts.value( i );
+ if ( atts.qName(i) == TQString("value") ) {
+ TQString value = atts.value( i );
int base = 10;
if ( value.startsWith("x") ) {
base = 16;
@@ -85,29 +85,29 @@ bool TsHandler::startElement( const QString& /* namespaceURI */,
}
int n = value.toUInt( 0, base );
if ( n != 0 )
- accum += QChar( n );
+ accum += TQChar( n );
}
}
} else {
- if ( qName == QString("context") ) {
+ if ( qName == TQString("context") ) {
context.truncate( 0 );
source.truncate( 0 );
comment.truncate( 0 );
translation.truncate( 0 );
contextIsUtf8 = encodingIsUtf8( atts );
- } else if ( qName == QString("message") ) {
+ } else if ( qName == TQString("message") ) {
inMessage = TRUE;
type = MetaTranslatorMessage::Finished;
source.truncate( 0 );
comment.truncate( 0 );
translation.truncate( 0 );
messageIsUtf8 = encodingIsUtf8( atts );
- } else if ( qName == QString("translation") ) {
+ } else if ( qName == TQString("translation") ) {
for ( int i = 0; i < atts.length(); i++ ) {
- if ( atts.qName(i) == QString("type") ) {
- if ( atts.value(i) == QString("unfinished") )
+ if ( atts.qName(i) == TQString("type") ) {
+ if ( atts.value(i) == TQString("unfinished") )
type = MetaTranslatorMessage::Unfinished;
- else if ( atts.value(i) == QString("obsolete") )
+ else if ( atts.value(i) == TQString("obsolete") )
type = MetaTranslatorMessage::Obsolete;
else
type = MetaTranslatorMessage::Finished;
@@ -119,33 +119,33 @@ bool TsHandler::startElement( const QString& /* namespaceURI */,
return TRUE;
}
-bool TsHandler::endElement( const QString& /* namespaceURI */,
- const QString& /* localName */,
- const QString& qName )
+bool TsHandler::endElement( const TQString& /* namespaceURI */,
+ const TQString& /* localName */,
+ const TQString& qName )
{
- if ( qName == QString("codec") || qName == QString("defaultcodec") ) {
+ if ( qName == TQString("codec") || qName == TQString("defaultcodec") ) {
// "codec" is a pre-3.0 syntax
tor->setCodec( accum );
- } else if ( qName == QString("name") ) {
+ } else if ( qName == TQString("name") ) {
context = accum;
- } else if ( qName == QString("source") ) {
+ } else if ( qName == TQString("source") ) {
source = accum;
- } else if ( qName == QString("comment") ) {
+ } else if ( qName == TQString("comment") ) {
if ( inMessage ) {
comment = accum;
} else {
if ( contextIsUtf8 )
tor->insert( MetaTranslatorMessage(context.utf8(), "",
- accum.utf8(), QString::null, TRUE,
+ accum.utf8(), TQString::null, TRUE,
MetaTranslatorMessage::Unfinished) );
else
tor->insert( MetaTranslatorMessage(context.ascii(), "",
- accum.ascii(), QString::null, FALSE,
+ accum.ascii(), TQString::null, FALSE,
MetaTranslatorMessage::Unfinished) );
}
- } else if ( qName == QString("translation") ) {
+ } else if ( qName == TQString("translation") ) {
translation = accum;
- } else if ( qName == QString("message") ) {
+ } else if ( qName == TQString("message") ) {
if ( messageIsUtf8 )
tor->insert( MetaTranslatorMessage(context.utf8(), source.utf8(),
comment.utf8(), translation,
@@ -159,56 +159,56 @@ bool TsHandler::endElement( const QString& /* namespaceURI */,
return TRUE;
}
-bool TsHandler::characters( const QString& ch )
+bool TsHandler::characters( const TQString& ch )
{
- QString t = ch;
- t.replace( QRegExp(QChar('\r')), "" );
+ TQString t = ch;
+ t.replace( TQRegExp(TQChar('\r')), "" );
accum += t;
return TRUE;
}
-bool TsHandler::fatalError( const QXmlParseException& exception )
+bool TsHandler::fatalError( const TQXmlParseException& exception )
{
if ( ferrorCount++ == 0 ) {
- QString msg;
+ TQString msg;
msg.sprintf( "Parse error at line %d, column %d (%s).",
exception.lineNumber(), exception.columnNumber(),
exception.message().latin1() );
if ( qApp == 0 )
qWarning( "XML error: %s", msg.latin1() );
else
- QMessageBox::information( qApp->mainWidget(),
- QObject::tr("Qt Linguist"), msg );
+ TQMessageBox::information( qApp->mainWidget(),
+ TQObject::tr("Qt Linguist"), msg );
}
return FALSE;
}
-static QString numericEntity( int ch )
+static TQString numericEntity( int ch )
{
- return QString( ch <= 0x20 ? "<byte value=\"x%1\"/>" : "&#x%1;" )
+ return TQString( ch <= 0x20 ? "<byte value=\"x%1\"/>" : "&#x%1;" )
.arg( ch, 0, 16 );
}
-static QString protect( const QCString& str )
+static TQString protect( const TQCString& str )
{
- QString result;
+ TQString result;
int len = (int) str.length();
for ( int k = 0; k < len; k++ ) {
switch( str[k] ) {
case '\"':
- result += QString( "&quot;" );
+ result += TQString( "&quot;" );
break;
case '&':
- result += QString( "&amp;" );
+ result += TQString( "&amp;" );
break;
case '>':
- result += QString( "&gt;" );
+ result += TQString( "&gt;" );
break;
case '<':
- result += QString( "&lt;" );
+ result += TQString( "&lt;" );
break;
case '\'':
- result += QString( "&apos;" );
+ result += TQString( "&apos;" );
break;
default:
if ( (uchar) str[k] < 0x20 && str[k] != '\n' )
@@ -220,19 +220,19 @@ static QString protect( const QCString& str )
return result;
}
-static QString evilBytes( const QCString& str, bool utf8 )
+static TQString evilBytes( const TQCString& str, bool utf8 )
{
if ( utf8 ) {
return protect( str );
} else {
- QString result;
- QCString t = protect( str ).latin1();
+ TQString result;
+ TQCString t = protect( str ).latin1();
int len = (int) t.length();
for ( int k = 0; k < len; k++ ) {
if ( (uchar) t[k] >= 0x7f )
result += numericEntity( (uchar) t[k] );
else
- result += QChar( t[k] );
+ result += TQChar( t[k] );
}
return result;
}
@@ -246,7 +246,7 @@ MetaTranslatorMessage::MetaTranslatorMessage()
MetaTranslatorMessage::MetaTranslatorMessage( const char *context,
const char *sourceText,
const char *comment,
- const QString& translation,
+ const TQString& translation,
bool utf8, Type type )
: QTranslatorMessage( context, sourceText, comment, translation ),
utfeight( FALSE ), ty( type )
@@ -330,23 +330,23 @@ MetaTranslator& MetaTranslator::operator=( const MetaTranslator& tor )
return *this;
}
-bool MetaTranslator::load( const QString& filename )
+bool MetaTranslator::load( const TQString& filename )
{
mm.clear();
- QFile f( filename );
+ TQFile f( filename );
if ( !f.open(IO_ReadOnly) )
return FALSE;
- QTextStream t( &f );
- QXmlInputSource in( t );
- QXmlSimpleReader reader;
+ TQTextStream t( &f );
+ TQXmlInputSource in( t );
+ TQXmlSimpleReader reader;
// don't click on these!
reader.setFeature( "http://xml.org/sax/features/namespaces", FALSE );
reader.setFeature( "http://xml.org/sax/features/namespace-prefixes", TRUE );
reader.setFeature( "http://trolltech.com/xml/features/report-whitespace"
"-only-CharData", FALSE );
- QXmlDefaultHandler *hand = new TsHandler( this );
+ TQXmlDefaultHandler *hand = new TsHandler( this );
reader.setContentHandler( hand );
reader.setErrorHandler( hand );
@@ -360,14 +360,14 @@ bool MetaTranslator::load( const QString& filename )
return ok;
}
-bool MetaTranslator::save( const QString& filename ) const
+bool MetaTranslator::save( const TQString& filename ) const
{
- QFile f( filename );
+ TQFile f( filename );
if ( !f.open(IO_WriteOnly) )
return FALSE;
- QTextStream t( &f );
- t.setCodec( QTextCodec::codecForName("ISO-8859-1") );
+ TQTextStream t( &f );
+ t.setCodec( TQTextCodec::codecForName("ISO-8859-1") );
t << "<!DOCTYPE TS><TS>\n";
if ( codecName != "ISO-8859-1" )
@@ -377,19 +377,19 @@ bool MetaTranslator::save( const QString& filename ) const
TMMInv inv;
TMMInv::Iterator i;
bool contextIsUtf8 = m.key().utf8();
- QCString context = m.key().context();
- QCString comment = "";
+ TQCString context = m.key().context();
+ TQCString comment = "";
do {
- if ( QCString(m.key().sourceText()).isEmpty() ) {
+ if ( TQCString(m.key().sourceText()).isEmpty() ) {
if ( m.key().type() != MetaTranslatorMessage::Obsolete ) {
contextIsUtf8 = m.key().utf8();
- comment = QCString( m.key().comment() );
+ comment = TQCString( m.key().comment() );
}
} else {
inv.insert( *m, m.key() );
}
- } while ( ++m != mm.end() && QCString(m.key().context()) == context );
+ } while ( ++m != mm.end() && TQCString(m.key().context()) == context );
t << "<context";
if ( contextIsUtf8 )
@@ -409,7 +409,7 @@ bool MetaTranslator::save( const QString& filename ) const
<< " <source>" << evilBytes( (*i).sourceText(),
(*i).utf8() )
<< "</source>\n";
- if ( !QCString((*i).comment()).isEmpty() )
+ if ( !TQCString((*i).comment()).isEmpty() )
t << " <comment>" << evilBytes( (*i).comment(),
(*i).utf8() )
<< "</comment>\n";
@@ -429,7 +429,7 @@ bool MetaTranslator::save( const QString& filename ) const
return TRUE;
}
-bool MetaTranslator::release( const QString& filename, bool verbose ) const
+bool MetaTranslator::release( const TQString& filename, bool verbose ) const
{
QTranslator tor( 0 );
int finished = 0;
@@ -494,7 +494,7 @@ void MetaTranslator::stripEmptyContexts()
TMM::Iterator m = mm.begin();
while ( m != mm.end() ) {
- if ( QCString(m.key().sourceText()).isEmpty() ) {
+ if ( TQCString(m.key().sourceText()).isEmpty() ) {
TMM::Iterator n = m;
++n;
// the context comment is followed by other messages
@@ -514,22 +514,22 @@ void MetaTranslator::setCodec( const char *name )
const int latin1 = 4;
codecName = name;
- codec = QTextCodec::codecForName( name );
+ codec = TQTextCodec::codecForName( name );
if ( codec == 0 || codec->mibEnum() == latin1 )
codec = 0;
}
-QString MetaTranslator::toUnicode( const char *str, bool utf8 ) const
+TQString MetaTranslator::toUnicode( const char *str, bool utf8 ) const
{
if ( utf8 )
- return QString::fromUtf8( str );
+ return TQString::fromUtf8( str );
else if ( codec == 0 )
- return QString( str );
+ return TQString( str );
else
return codec->toUnicode( str );
}
-QValueList<MetaTranslatorMessage> MetaTranslator::messages() const
+TQValueList<MetaTranslatorMessage> MetaTranslator::messages() const
{
int n = mm.count();
TMM::ConstIterator *t = new TMM::ConstIterator[n + 1];
@@ -537,7 +537,7 @@ QValueList<MetaTranslatorMessage> MetaTranslator::messages() const
for ( m = mm.begin(); m != mm.end(); ++m )
t[*m] = m;
- QValueList<MetaTranslatorMessage> val;
+ TQValueList<MetaTranslatorMessage> val;
for ( int i = 0; i < n; i++ )
val.append( t[i].key() );
@@ -545,9 +545,9 @@ QValueList<MetaTranslatorMessage> MetaTranslator::messages() const
return val;
}
-QValueList<MetaTranslatorMessage> MetaTranslator::translatedMessages() const
+TQValueList<MetaTranslatorMessage> MetaTranslator::translatedMessages() const
{
- QValueList<MetaTranslatorMessage> val;
+ TQValueList<MetaTranslatorMessage> val;
TMM::ConstIterator m;
for ( m = mm.begin(); m != mm.end(); ++m ) {
if ( m.key().type() == MetaTranslatorMessage::Finished )
diff --git a/python/pyqt/pylupdate3/metatranslator.h b/python/pyqt/pylupdate3/metatranslator.h
index a071207e..eb2a645d 100644
--- a/python/pyqt/pylupdate3/metatranslator.h
+++ b/python/pyqt/pylupdate3/metatranslator.h
@@ -17,10 +17,10 @@
#ifndef METATRANSLATOR_H
#define METATRANSLATOR_H
-#include <qmap.h>
-#include <qstring.h>
-#include <qtranslator.h>
-#include <qvaluelist.h>
+#include <tqmap.h>
+#include <tqstring.h>
+#include <tqtranslator.h>
+#include <tqvaluelist.h>
class QTextCodec;
@@ -32,7 +32,7 @@ public:
MetaTranslatorMessage();
MetaTranslatorMessage( const char *context, const char *sourceText,
const char *comment,
- const QString& translation = QString::null,
+ const TQString& translation = TQString::null,
bool utf8 = FALSE, Type type = Unfinished );
MetaTranslatorMessage( const MetaTranslatorMessage& m );
@@ -66,9 +66,9 @@ public:
MetaTranslator& operator=( const MetaTranslator& tor );
- bool load( const QString& filename );
- bool save( const QString& filename ) const;
- bool release( const QString& filename, bool verbose = FALSE ) const;
+ bool load( const TQString& filename );
+ bool save( const TQString& filename ) const;
+ bool release( const TQString& filename, bool verbose = FALSE ) const;
bool contains( const char *context, const char *sourceText,
const char *comment ) const;
@@ -78,18 +78,18 @@ public:
void stripEmptyContexts();
void setCodec( const char *name );
- QString toUnicode( const char *str, bool utf8 ) const;
+ TQString toUnicode( const char *str, bool utf8 ) const;
- QValueList<MetaTranslatorMessage> messages() const;
- QValueList<MetaTranslatorMessage> translatedMessages() const;
+ TQValueList<MetaTranslatorMessage> messages() const;
+ TQValueList<MetaTranslatorMessage> translatedMessages() const;
private:
- typedef QMap<MetaTranslatorMessage, int> TMM;
- typedef QMap<int, MetaTranslatorMessage> TMMInv;
+ typedef TQMap<MetaTranslatorMessage, int> TMM;
+ typedef TQMap<int, MetaTranslatorMessage> TMMInv;
TMM mm;
- QCString codecName;
- QTextCodec *codec;
+ TQCString codecName;
+ TQTextCodec *codec;
};
#endif
diff --git a/python/pyqt/pylupdate3/numberh.cpp b/python/pyqt/pylupdate3/numberh.cpp
index 67048031..2280ba27 100644
--- a/python/pyqt/pylupdate3/numberh.cpp
+++ b/python/pyqt/pylupdate3/numberh.cpp
@@ -14,16 +14,16 @@
**
**********************************************************************/
-#include <qmemarray.h>
-#include <qcstring.h>
-#include <qmap.h>
-#include <qstringlist.h>
+#include <tqmemarray.h>
+#include <tqcstring.h>
+#include <tqmap.h>
+#include <tqstringlist.h>
#include <ctype.h>
#include <metatranslator.h>
-typedef QMap<QCString, MetaTranslatorMessage> TMM;
-typedef QValueList<MetaTranslatorMessage> TML;
+typedef TQMap<TQCString, MetaTranslatorMessage> TMM;
+typedef TQValueList<MetaTranslatorMessage> TML;
static bool isDigitFriendly( int c )
{
@@ -49,9 +49,9 @@ static int numberLength( const char *s )
Returns a version of 'key' where all numbers have been replaced by zeroes. If
there were none, returns "".
*/
-static QCString zeroKey( const char *key )
+static TQCString zeroKey( const char *key )
{
- QCString zeroed( strlen(key) + 1 );
+ TQCString zeroed( strlen(key) + 1 );
char *z = zeroed.data();
int i = 0, j = 0;
int len;
@@ -75,17 +75,17 @@ static QCString zeroKey( const char *key )
return "";
}
-static QString translationAttempt( const QString& oldTranslation,
+static TQString translationAttempt( const TQString& oldTranslation,
const char *oldSource,
const char *newSource )
{
int p = zeroKey( oldSource ).contains( '0' );
int oldSourceLen = qstrlen( oldSource );
- QString attempt;
- QStringList oldNumbers;
- QStringList newNumbers;
- QMemArray<bool> met( p );
- QMemArray<int> matchedYet( p );
+ TQString attempt;
+ TQStringList oldNumbers;
+ TQStringList newNumbers;
+ TQMemArray<bool> met( p );
+ TQMemArray<int> matchedYet( p );
int i, j;
int k = 0, ell, best;
int m, n;
@@ -103,8 +103,8 @@ static QString translationAttempt( const QString& oldTranslation,
m = numberLength( oldSource + i );
n = numberLength( newSource + j );
if ( m > 0 ) {
- oldNumbers.append( QCString(oldSource + i, m + 1) );
- newNumbers.append( QCString(newSource + j, n + 1) );
+ oldNumbers.append( TQCString(oldSource + i, m + 1) );
+ newNumbers.append( TQCString(newSource + j, n + 1) );
i += m;
j += n;
met[k] = FALSE;
@@ -168,7 +168,7 @@ static QString translationAttempt( const QString& oldTranslation,
*/
for ( k = 0; k < p; k++ ) {
if ( !met[k] )
- attempt += QString( " {" ) + newNumbers[k] + QString( "?}" );
+ attempt += TQString( " {" ) + newNumbers[k] + TQString( "?}" );
}
/*
@@ -180,8 +180,8 @@ static QString translationAttempt( const QString& oldTranslation,
for ( ell = 0; ell < p; ell++ ) {
if ( k != ell && oldNumbers[k] == oldNumbers[ell] &&
newNumbers[k] < newNumbers[ell] )
- attempt += QString( " {" ) + newNumbers[k] + QString( " or " ) +
- newNumbers[ell] + QString( "?}" );
+ attempt += TQString( " {" ) + newNumbers[k] + TQString( " or " ) +
+ newNumbers[ell] + TQString( "?}" );
}
}
return attempt;
diff --git a/python/pyqt/pylupdate3/proparser.cpp b/python/pyqt/pylupdate3/proparser.cpp
index f018b4c3..6010cbeb 100644
--- a/python/pyqt/pylupdate3/proparser.cpp
+++ b/python/pyqt/pylupdate3/proparser.cpp
@@ -14,58 +14,58 @@
**
**********************************************************************/
-#include <qregexp.h>
-#include <qstringlist.h>
+#include <tqregexp.h>
+#include <tqstringlist.h>
#include "proparser.h"
-QMap<QString, QString> proFileTagMap( const QString& text )
+TQMap<TQString, TQString> proFileTagMap( const TQString& text )
{
- QString t = text;
+ TQString t = text;
/*
Strip comments, merge lines ending with backslash, add
spaces around '=' and '+=', replace '\n' with ';', and
simplify white spaces.
*/
- t.replace( QRegExp(QString("#[^\n]$")), QString(" ") );
- t.replace( QRegExp(QString("\\\\\\s*\n")), QString(" ") );
- t.replace( QRegExp(QString("=")), QString(" = ") );
- t.replace( QRegExp(QString("\\+ =")), QString(" += ") );
- t.replace( QRegExp(QString("\n")), QString(";") );
+ t.replace( TQRegExp(TQString("#[^\n]$")), TQString(" ") );
+ t.replace( TQRegExp(TQString("\\\\\\s*\n")), TQString(" ") );
+ t.replace( TQRegExp(TQString("=")), TQString(" = ") );
+ t.replace( TQRegExp(TQString("\\+ =")), TQString(" += ") );
+ t.replace( TQRegExp(TQString("\n")), TQString(";") );
t = t.simplifyWhiteSpace();
- QMap<QString, QString> tagMap;
+ TQMap<TQString, TQString> tagMap;
- QStringList lines = QStringList::split( QChar(';'), t );
- QStringList::Iterator line;
+ TQStringList lines = TQStringList::split( TQChar(';'), t );
+ TQStringList::Iterator line;
for ( line = lines.begin(); line != lines.end(); ++line ) {
- QStringList toks = QStringList::split( QChar(' '), *line );
+ TQStringList toks = TQStringList::split( TQChar(' '), *line );
if ( toks.count() >= 3 &&
- (toks[1] == QString("=") || toks[1] == QString("+=")) ) {
- QString tag = toks.first();
- int k = tag.findRev( QChar(':') ); // as in 'unix:'
+ (toks[1] == TQString("=") || toks[1] == TQString("+=")) ) {
+ TQString tag = toks.first();
+ int k = tag.findRev( TQChar(':') ); // as in 'unix:'
if ( k != -1 )
tag = tag.mid( k + 1 );
toks.remove( toks.begin() );
- QString action = toks.first();
+ TQString action = toks.first();
toks.remove( toks.begin() );
if ( tagMap.contains(tag) ) {
- if ( action == QString("=") )
- tagMap.replace( tag, toks.join(QChar(' ')) );
+ if ( action == TQString("=") )
+ tagMap.replace( tag, toks.join(TQChar(' ')) );
else
- tagMap[tag] += QChar( ' ' ) + toks.join( QChar(' ') );
+ tagMap[tag] += TQChar( ' ' ) + toks.join( TQChar(' ') );
} else {
- tagMap[tag] = toks.join( QChar(' ') );
+ tagMap[tag] = toks.join( TQChar(' ') );
}
}
}
- QRegExp var( "\\$\\$[a-zA-Z0-9_]+" );
- QMap<QString, QString>::Iterator it;
+ TQRegExp var( "\\$\\$[a-zA-Z0-9_]+" );
+ TQMap<TQString, TQString>::Iterator it;
for ( it = tagMap.begin(); it != tagMap.end(); ++it ) {
int i = 0;
diff --git a/python/pyqt/pylupdate3/proparser.h b/python/pyqt/pylupdate3/proparser.h
index 2a66c8ab..7d0df31a 100644
--- a/python/pyqt/pylupdate3/proparser.h
+++ b/python/pyqt/pylupdate3/proparser.h
@@ -17,9 +17,9 @@
#ifndef PROPARSER_H
#define PROPARSER_H
-#include <qmap.h>
-#include <qstring.h>
+#include <tqmap.h>
+#include <tqstring.h>
-QMap<QString, QString> proFileTagMap( const QString& text );
+TQMap<TQString, TQString> proFileTagMap( const TQString& text );
#endif
diff --git a/python/pyqt/pylupdate3/sametexth.cpp b/python/pyqt/pylupdate3/sametexth.cpp
index 1ee869f2..c007cfc3 100644
--- a/python/pyqt/pylupdate3/sametexth.cpp
+++ b/python/pyqt/pylupdate3/sametexth.cpp
@@ -14,13 +14,13 @@
**
**********************************************************************/
-#include <qcstring.h>
-#include <qmap.h>
+#include <tqcstring.h>
+#include <tqmap.h>
#include <metatranslator.h>
-typedef QMap<QCString, MetaTranslatorMessage> TMM;
-typedef QValueList<MetaTranslatorMessage> TML;
+typedef TQMap<TQCString, MetaTranslatorMessage> TMM;
+typedef TQValueList<MetaTranslatorMessage> TML;
/*
Augments a MetaTranslator with trivially derived translations.
@@ -45,7 +45,7 @@ void applySameTextHeuristic( MetaTranslator *tor, bool verbose )
if ( (*it).translation().isEmpty() )
untranslated.append( *it );
} else {
- QCString key = (*it).sourceText();
+ TQCString key = (*it).sourceText();
t = translated.find( key );
if ( t != translated.end() ) {
/*
@@ -63,7 +63,7 @@ void applySameTextHeuristic( MetaTranslator *tor, bool verbose )
}
for ( u = untranslated.begin(); u != untranslated.end(); ++u ) {
- QCString key = (*u).sourceText();
+ TQCString key = (*u).sourceText();
t = translated.find( key );
if ( t != translated.end() ) {
MetaTranslatorMessage m( *u );