summaryrefslogtreecommitdiffstats
path: root/pylupdate3
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-29 01:11:08 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-29 01:11:08 -0600
commit8a055d66f43592c257cece2eb8cc021808062917 (patch)
treed0922f201bd5d24b62a33160d1d9baf9e89f9a70 /pylupdate3
parentb388516ca2691303a076a0764fd40bf7116fe43d (diff)
downloadpytqt-8a055d66f43592c257cece2eb8cc021808062917.tar.gz
pytqt-8a055d66f43592c257cece2eb8cc021808062917.zip
Initial TQt conversion
Diffstat (limited to 'pylupdate3')
-rw-r--r--pylupdate3/LICENSE.GPL12
-rw-r--r--pylupdate3/fetchtr.cpp40
-rw-r--r--pylupdate3/main.cpp34
-rw-r--r--pylupdate3/merge.cpp8
-rw-r--r--pylupdate3/metatranslator.cpp192
-rw-r--r--pylupdate3/metatranslator.h28
-rw-r--r--pylupdate3/numberh.cpp32
-rw-r--r--pylupdate3/proparser.cpp44
-rw-r--r--pylupdate3/proparser.h4
-rw-r--r--pylupdate3/pylupdate-prof.sbf10
-rw-r--r--pylupdate3/pylupdate.pro.in2
-rw-r--r--pylupdate3/pylupdate.sbf10
-rw-r--r--pylupdate3/sametexth.cpp10
13 files changed, 213 insertions, 213 deletions
diff --git a/pylupdate3/LICENSE.GPL b/pylupdate3/LICENSE.GPL
index c7aea18..fc80518 100644
--- a/pylupdate3/LICENSE.GPL
+++ b/pylupdate3/LICENSE.GPL
@@ -109,9 +109,9 @@ above, provided that you also meet all of these conditions:
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
+ the Program is not retquired to print an announcement.)
-These requirements apply to the modified work as a whole. If
+These retquirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
@@ -177,7 +177,7 @@ However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
- 5. You are not required to accept this License, since you have not
+ 5. You are not retquired to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
@@ -263,14 +263,14 @@ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+TO THE TQUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+ 12. IN NO EVENT UNLESS RETQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSETQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
diff --git a/pylupdate3/fetchtr.cpp b/pylupdate3/fetchtr.cpp
index 609dbc1..74f683d 100644
--- a/pylupdate3/fetchtr.cpp
+++ b/pylupdate3/fetchtr.cpp
@@ -1,7 +1,7 @@
/**********************************************************************
** Copyright (C) 2002 Detlev Offenbach <detlev@die-offenbachs.de>
**
-** This is a modified version of lupdate. The original is part of Qt-Linguist.
+** This is a modified version of lupdate. The original is part of TQt-Linguist.
** The copyright of the original file can be found below.
**
** This version is modified to handle python sources.
@@ -18,7 +18,7 @@
**
** fetchtr.cpp
**
-** This file is part of Qt Linguist.
+** This file is part of TQt Linguist.
**
** See the file LICENSE included in the distribution for the usage
** and distribution terms.
@@ -44,8 +44,8 @@
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/pylupdate3/main.cpp b/pylupdate3/main.cpp
index 427fed5..63f54c0 100644
--- a/pylupdate3/main.cpp
+++ b/pylupdate3/main.cpp
@@ -1,7 +1,7 @@
/**********************************************************************
** Copyright (C) 2002 Detlev Offenbach <detlev@die-offenbachs.de>
**
-** This is a modified version of lupdate. The original is part of Qt-Linguist.
+** This is a modified version of lupdate. The original is part of TQt-Linguist.
** The copyright of the original file can be found below.
**
** This version is modified to handle python sources.
@@ -18,7 +18,7 @@
**
** main.cpp
**
-** This file is part of Qt Linguist.
+** This file is part of TQt Linguist.
**
** See the file LICENSE included in the distribution for the usage
** and distribution terms.
@@ -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/pylupdate3/merge.cpp b/pylupdate3/merge.cpp
index c569c93..d40c92c 100644
--- a/pylupdate3/merge.cpp
+++ b/pylupdate3/merge.cpp
@@ -3,7 +3,7 @@
**
** merge.cpp
**
-** This file is part of Qt Linguist.
+** This file is part of TQt Linguist.
**
** See the file LICENSE included in the distribution for the usage
** and distribution terms.
@@ -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/pylupdate3/metatranslator.cpp b/pylupdate3/metatranslator.cpp
index c3d0673..4b67c32 100644
--- a/pylupdate3/metatranslator.cpp
+++ b/pylupdate3/metatranslator.cpp
@@ -3,7 +3,7 @@
**
** metatranslator.cpp
**
-** This file is part of Qt Linguist.
+** This file is part of TQt Linguist.
**
** See the file LICENSE included in the distribution for the usage
** and distribution terms.
@@ -25,20 +25,20 @@
#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;
}
-class TsHandler : public QXmlDefaultHandler
+class TsHandler : public TQXmlDefaultHandler
{
public:
TsHandler( MetaTranslator *translator )
@@ -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("TQt 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,9 +246,9 @@ 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 ),
+ : TQTranslatorMessage( context, sourceText, comment, translation ),
utfeight( FALSE ), ty( type )
{
/*
@@ -281,14 +281,14 @@ MetaTranslatorMessage::MetaTranslatorMessage( const char *context,
}
MetaTranslatorMessage::MetaTranslatorMessage( const MetaTranslatorMessage& m )
- : QTranslatorMessage( m ), utfeight( m.utfeight ), ty( m.ty )
+ : TQTranslatorMessage( m ), utfeight( m.utfeight ), ty( m.ty )
{
}
MetaTranslatorMessage& MetaTranslatorMessage::operator=(
const MetaTranslatorMessage& m )
{
- QTranslatorMessage::operator=( m );
+ TQTranslatorMessage::operator=( m );
utfeight = m.utfeight;
ty = m.ty;
return *this;
@@ -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,9 +429,9 @@ 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 );
+ TQTranslator tor( 0 );
int finished = 0;
int unfinished = 0;
int untranslated = 0;
@@ -451,7 +451,7 @@ bool MetaTranslator::release( const QString& filename, bool verbose ) const
}
}
- bool saved = tor.save( filename, QTranslator::Stripped );
+ bool saved = tor.save( filename, TQTranslator::Stripped );
if ( saved && verbose )
qWarning( " %d finished, %d unfinished and %d untranslated messages",
finished, unfinished, untranslated );
@@ -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/pylupdate3/metatranslator.h b/pylupdate3/metatranslator.h
index a071207..5bf3961 100644
--- a/pylupdate3/metatranslator.h
+++ b/pylupdate3/metatranslator.h
@@ -3,7 +3,7 @@
**
** metatranslator.h
**
-** This file is part of Qt Linguist.
+** This file is part of TQt Linguist.
**
** See the file LICENSE included in the distribution for the usage
** and distribution terms.
@@ -22,9 +22,9 @@
#include <qtranslator.h>
#include <qvaluelist.h>
-class QTextCodec;
+class TQTextCodec;
-class MetaTranslatorMessage : public QTranslatorMessage
+class MetaTranslatorMessage : public TQTranslatorMessage
{
public:
enum Type { Unfinished, Finished, Obsolete };
@@ -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/pylupdate3/numberh.cpp b/pylupdate3/numberh.cpp
index 6704803..7c5f7ee 100644
--- a/pylupdate3/numberh.cpp
+++ b/pylupdate3/numberh.cpp
@@ -3,7 +3,7 @@
**
** numberh.cpp
**
-** This file is part of Qt Linguist.
+** This file is part of TQt Linguist.
**
** See the file LICENSE included in the distribution for the usage
** and distribution terms.
@@ -22,8 +22,8 @@
#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/pylupdate3/proparser.cpp b/pylupdate3/proparser.cpp
index f018b4c..edb86c1 100644
--- a/pylupdate3/proparser.cpp
+++ b/pylupdate3/proparser.cpp
@@ -3,7 +3,7 @@
**
** proparser.cpp
**
-** This file is part of Qt Linguist.
+** This file is part of TQt Linguist.
**
** See the file LICENSE included in the distribution for the usage
** and distribution terms.
@@ -19,53 +19,53 @@
#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/pylupdate3/proparser.h b/pylupdate3/proparser.h
index 2a66c8a..953f0ea 100644
--- a/pylupdate3/proparser.h
+++ b/pylupdate3/proparser.h
@@ -3,7 +3,7 @@
**
** proparser.h
**
-** This file is part of Qt Linguist.
+** This file is part of TQt Linguist.
**
** See the file LICENSE included in the distribution for the usage
** and distribution terms.
@@ -20,6 +20,6 @@
#include <qmap.h>
#include <qstring.h>
-QMap<QString, QString> proFileTagMap( const QString& text );
+TQMap<TQString, TQString> proFileTagMap( const TQString& text );
#endif
diff --git a/pylupdate3/pylupdate-prof.sbf b/pylupdate3/pylupdate-prof.sbf
index 7a4c3c4..2d74dfa 100644
--- a/pylupdate3/pylupdate-prof.sbf
+++ b/pylupdate3/pylupdate-prof.sbf
@@ -1,22 +1,22 @@
-# This is the build file for pylupdate for Qt v3 Professional Edition.
+# This is the build file for pylupdate for TQt v3 Professional Edition.
#
# Copyright (c) 2007
# Riverbank Computing Limited <info@riverbankcomputing.co.uk>
#
-# This file is part of PyQt.
+# This file is part of PyTQt.
#
-# This copy of PyQt is free software; you can redistribute it and/or modify it
+# This copy of PyTQt is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2, or (at your option) any later
# version.
#
-# PyQt is supplied in the hope that it will be useful, but WITHOUT ANY
+# PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
-# PyQt; see the file LICENSE. If not, write to the Free Software Foundation,
+# PyTQt; see the file LICENSE. If not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
target = pylupdate
diff --git a/pylupdate3/pylupdate.pro.in b/pylupdate3/pylupdate.pro.in
index c21725c..51f45a9 100644
--- a/pylupdate3/pylupdate.pro.in
+++ b/pylupdate3/pylupdate.pro.in
@@ -1,7 +1,7 @@
# Copyright (c) 2002
# Detlev Offenbach <detlev@die-offenbachs.de>
#
-# The project file pylupdate for Qt v3.
+# The project file pylupdate for TQt v3.
TEMPLATE = app
diff --git a/pylupdate3/pylupdate.sbf b/pylupdate3/pylupdate.sbf
index ec501ab..248b7cb 100644
--- a/pylupdate3/pylupdate.sbf
+++ b/pylupdate3/pylupdate.sbf
@@ -1,22 +1,22 @@
-# This is the build file for pylupdate for Qt v3 Professional Edition.
+# This is the build file for pylupdate for TQt v3 Professional Edition.
#
# Copyright (c) 2007
# Riverbank Computing Limited <info@riverbankcomputing.co.uk>
#
-# This file is part of PyQt.
+# This file is part of PyTQt.
#
-# This copy of PyQt is free software; you can redistribute it and/or modify it
+# This copy of PyTQt is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2, or (at your option) any later
# version.
#
-# PyQt is supplied in the hope that it will be useful, but WITHOUT ANY
+# PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
-# PyQt; see the file LICENSE. If not, write to the Free Software Foundation,
+# PyTQt; see the file LICENSE. If not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
target = pylupdate
diff --git a/pylupdate3/sametexth.cpp b/pylupdate3/sametexth.cpp
index 1ee869f..53e1fa7 100644
--- a/pylupdate3/sametexth.cpp
+++ b/pylupdate3/sametexth.cpp
@@ -3,7 +3,7 @@
**
** sametexth.cpp
**
-** This file is part of Qt Linguist.
+** This file is part of TQt Linguist.
**
** See the file LICENSE included in the distribution for the usage
** and distribution terms.
@@ -19,8 +19,8 @@
#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 );