summaryrefslogtreecommitdiffstats
path: root/pytqlupdate3
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2025-04-04 13:24:31 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2025-04-04 21:11:58 +0900
commit2d2a66210c4827dd2469d4fde55bf2c9aab81b5a (patch)
tree8a1b99c230b11fb6e679434055553504620119c7 /pytqlupdate3
parentf89d120a2d4982896f0b5c00cee347a010f609a9 (diff)
downloadpytqt-r14.1.4.tar.gz
pytqt-r14.1.4.zip
Replace TRUE/FALSE with boolean values true/falser14.1.4
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 6cbdd25dc4c6b0987636b37b2046b1b9464e3d60)
Diffstat (limited to 'pytqlupdate3')
-rw-r--r--pytqlupdate3/fetchtr.cpp10
-rw-r--r--pytqlupdate3/main.cpp16
-rw-r--r--pytqlupdate3/metatranslator.cpp46
-rw-r--r--pytqlupdate3/metatranslator.h4
-rw-r--r--pytqlupdate3/numberh.cpp8
5 files changed, 42 insertions, 42 deletions
diff --git a/pytqlupdate3/fetchtr.cpp b/pytqlupdate3/fetchtr.cpp
index 0127394..9c66a2f 100644
--- a/pytqlupdate3/fetchtr.cpp
+++ b/pytqlupdate3/fetchtr.cpp
@@ -332,9 +332,9 @@ static bool matchEncoding( bool *utf8 )
}
*utf8 = TQString( yyIdent ).endsWith( TQString("UTF8") );
yyTok = getToken();
- return TRUE;
+ return true;
} else {
- return FALSE;
+ return false;
}
}
@@ -347,7 +347,7 @@ static void parse( MetaTranslator *tor, const char *initialContext,
TQCString com;
TQCString functionContext = initialContext;
TQCString prefix;
- bool utf8 = FALSE;
+ bool utf8 = false;
yyTok = getToken();
while ( yyTok != Tok_Eof ) {
@@ -382,7 +382,7 @@ static void parse( MetaTranslator *tor, const char *initialContext,
}
break;
case Tok_translate:
- utf8 = FALSE;
+ utf8 = false;
yyTok = getToken();
if ( match(Tok_LeftParen) &&
matchString(&context) &&
@@ -420,7 +420,7 @@ static void parse( MetaTranslator *tor, const char *initialContext,
context = com.left( k );
com.remove( 0, k + 1 );
tor->insert( MetaTranslatorMessage(context, "", com,
- TQString::null, FALSE) );
+ TQString::null, false) );
}
}
yyTok = getToken();
diff --git a/pytqlupdate3/main.cpp b/pytqlupdate3/main.cpp
index f024072..87b2a68 100644
--- a/pytqlupdate3/main.cpp
+++ b/pytqlupdate3/main.cpp
@@ -64,9 +64,9 @@ static void printUsage()
int main( int argc, char **argv )
{
- bool verbose = FALSE;
- bool noObsolete = FALSE;
- bool metSomething = FALSE;
+ bool verbose = false;
+ bool noObsolete = false;
+ bool metSomething = false;
int numProFiles = 0;
for ( int i = 1; i < argc; i++ ) {
@@ -74,10 +74,10 @@ int main( int argc, char **argv )
printUsage();
return 0;
} else if ( qstrcmp(argv[i], "-noobsolete") == 0 ) {
- noObsolete = TRUE;
+ noObsolete = true;
continue;
} else if ( qstrcmp(argv[i], "-verbose") == 0 ) {
- verbose = TRUE;
+ verbose = true;
continue;
} else if ( qstrcmp(argv[i], "-version") == 0 ) {
tqWarning( "pytqlupdate version %s", TQT_VERSION_STR );
@@ -112,11 +112,11 @@ int main( int argc, char **argv )
for ( t = toks.begin(); t != toks.end(); ++t ) {
if ( it.key() == TQString("SOURCES") ) {
fetchtr_py( *t, &fetchedTor,
- defaultContext, TRUE );
- metSomething = TRUE;
+ defaultContext, true );
+ metSomething = true;
} else if ( it.key() == TQString("TRANSLATIONS") ) {
translatorFiles.append( *t );
- metSomething = TRUE;
+ metSomething = true;
} else if ( it.key() == TQString("CODEC") ) {
codec = (*t).utf8();
}
diff --git a/pytqlupdate3/metatranslator.cpp b/pytqlupdate3/metatranslator.cpp
index 18b2b0d..62a5386 100644
--- a/pytqlupdate3/metatranslator.cpp
+++ b/pytqlupdate3/metatranslator.cpp
@@ -35,7 +35,7 @@ static bool encodingIsUtf8( const TQXmlAttributes& atts )
return ( atts.value(i) == TQString("UTF-8") );
}
}
- return FALSE;
+ return false;
}
class TsHandler : public TQXmlDefaultHandler
@@ -43,8 +43,8 @@ class TsHandler : public TQXmlDefaultHandler
public:
TsHandler( MetaTranslator *translator )
: tor( translator ), type( MetaTranslatorMessage::Finished ),
- inMessage( FALSE ), ferrorCount( 0 ), contextIsUtf8( FALSE ),
- messageIsUtf8( FALSE ) { }
+ inMessage( false ), ferrorCount( 0 ), contextIsUtf8( false ),
+ messageIsUtf8( false ) { }
virtual bool startElement( const TQString& namespaceURI,
const TQString& localName, const TQString& qName,
@@ -96,7 +96,7 @@ bool TsHandler::startElement( const TQString& /* namespaceURI */,
translation.truncate( 0 );
contextIsUtf8 = encodingIsUtf8( atts );
} else if ( qName == TQString("message") ) {
- inMessage = TRUE;
+ inMessage = true;
type = MetaTranslatorMessage::Finished;
source.truncate( 0 );
comment.truncate( 0 );
@@ -116,7 +116,7 @@ bool TsHandler::startElement( const TQString& /* namespaceURI */,
}
accum.truncate( 0 );
}
- return TRUE;
+ return true;
}
bool TsHandler::endElement( const TQString& /* namespaceURI */,
@@ -136,11 +136,11 @@ bool TsHandler::endElement( const TQString& /* namespaceURI */,
} else {
if ( contextIsUtf8 )
tor->insert( MetaTranslatorMessage(context.utf8(), "",
- accum.utf8(), TQString::null, TRUE,
+ accum.utf8(), TQString::null, true,
MetaTranslatorMessage::Unfinished) );
else
tor->insert( MetaTranslatorMessage(context.local8Bit(), "",
- accum.local8Bit(), TQString::null, FALSE,
+ accum.local8Bit(), TQString::null, false,
MetaTranslatorMessage::Unfinished) );
}
} else if ( qName == TQString("translation") ) {
@@ -149,14 +149,14 @@ bool TsHandler::endElement( const TQString& /* namespaceURI */,
if ( messageIsUtf8 )
tor->insert( MetaTranslatorMessage(context.utf8(), source.utf8(),
comment.utf8(), translation,
- TRUE, type) );
+ true, type) );
else
tor->insert( MetaTranslatorMessage(context.local8Bit(), source.local8Bit(),
comment.local8Bit(), translation,
- FALSE, type) );
- inMessage = FALSE;
+ false, type) );
+ inMessage = false;
}
- return TRUE;
+ return true;
}
bool TsHandler::characters( const TQString& ch )
@@ -164,7 +164,7 @@ bool TsHandler::characters( const TQString& ch )
TQString t = ch;
t.replace( TQRegExp(TQChar('\r')), "" );
accum += t;
- return TRUE;
+ return true;
}
bool TsHandler::fatalError( const TQXmlParseException& exception )
@@ -180,7 +180,7 @@ bool TsHandler::fatalError( const TQXmlParseException& exception )
TQMessageBox::information( tqApp->mainWidget(),
TQObject::tr("TQt Linguist"), msg );
}
- return FALSE;
+ return false;
}
static TQString numericEntity( int ch )
@@ -239,7 +239,7 @@ static TQString evilBytes( const TQCString& str, bool utf8 )
}
MetaTranslatorMessage::MetaTranslatorMessage()
- : utfeight( FALSE ), ty( Unfinished )
+ : utfeight( false ), ty( Unfinished )
{
}
@@ -249,7 +249,7 @@ MetaTranslatorMessage::MetaTranslatorMessage( const char *context,
const TQString& translation,
bool utf8, Type type )
: TQTranslatorMessage( context, sourceText, comment, translation ),
- utfeight( FALSE ), ty( type )
+ utfeight( false ), ty( type )
{
/*
Don't use UTF-8 if it makes no difference. UTF-8 should be
@@ -261,7 +261,7 @@ MetaTranslatorMessage::MetaTranslatorMessage( const char *context,
int i = 0;
while ( sourceText[i] != '\0' ) {
if ( (uchar) sourceText[i] >= 0x80 ) {
- utfeight = TRUE;
+ utfeight = true;
break;
}
i++;
@@ -271,7 +271,7 @@ MetaTranslatorMessage::MetaTranslatorMessage( const char *context,
int i = 0;
while ( comment[i] != '\0' ) {
if ( (uchar) comment[i] >= 0x80 ) {
- utfeight = TRUE;
+ utfeight = true;
break;
}
i++;
@@ -336,16 +336,16 @@ bool MetaTranslator::load( const TQString& filename )
TQFile f( filename );
if ( !f.open(IO_ReadOnly) )
- return FALSE;
+ return false;
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://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 );
+ "-only-CharData", false );
TQXmlDefaultHandler *hand = new TsHandler( this );
reader.setContentHandler( hand );
reader.setErrorHandler( hand );
@@ -364,7 +364,7 @@ bool MetaTranslator::save( const TQString& filename ) const
{
TQFile f( filename );
if ( !f.open(IO_WriteOnly) )
- return FALSE;
+ return false;
TQTextStream t( &f );
t.setCodec( TQTextCodec::codecForName("ISO-8859-1") );
@@ -426,7 +426,7 @@ bool MetaTranslator::save( const TQString& filename ) const
}
t << "</TS>\n";
f.close();
- return TRUE;
+ return true;
}
bool MetaTranslator::release( const TQString& filename, bool verbose ) const
diff --git a/pytqlupdate3/metatranslator.h b/pytqlupdate3/metatranslator.h
index aab280f..abe0293 100644
--- a/pytqlupdate3/metatranslator.h
+++ b/pytqlupdate3/metatranslator.h
@@ -33,7 +33,7 @@ public:
MetaTranslatorMessage( const char *context, const char *sourceText,
const char *comment,
const TQString& translation = TQString::null,
- bool utf8 = FALSE, Type type = Unfinished );
+ bool utf8 = false, Type type = Unfinished );
MetaTranslatorMessage( const MetaTranslatorMessage& m );
MetaTranslatorMessage& operator=( const MetaTranslatorMessage& m );
@@ -68,7 +68,7 @@ public:
bool load( const TQString& filename );
bool save( const TQString& filename ) const;
- bool release( const TQString& filename, bool verbose = FALSE ) const;
+ bool release( const TQString& filename, bool verbose = false ) const;
bool contains( const char *context, const char *sourceText,
const char *comment ) const;
diff --git a/pytqlupdate3/numberh.cpp b/pytqlupdate3/numberh.cpp
index a52687b..1392b60 100644
--- a/pytqlupdate3/numberh.cpp
+++ b/pytqlupdate3/numberh.cpp
@@ -55,14 +55,14 @@ static TQCString zeroKey( const char *key )
char *z = zeroed.data();
int i = 0, j = 0;
int len;
- bool metSomething = FALSE;
+ bool metSomething = false;
while ( key[i] != '\0' ) {
len = numberLength( key + i );
if ( len > 0 ) {
i += len;
z[j++] = '0';
- metSomething = TRUE;
+ metSomething = true;
} else {
z[j++] = key[i++];
}
@@ -107,7 +107,7 @@ static TQString translationAttempt( const TQString& oldTranslation,
newNumbers.append( TQCString(newSource + j, n + 1) );
i += m;
j += n;
- met[k] = FALSE;
+ met[k] = false;
matchedYet[k] = 0;
k++;
}
@@ -150,7 +150,7 @@ static TQString translationAttempt( const TQString& oldTranslation,
if ( best != p ) {
attempt.truncate( attempt.length() - matchedYet[best] );
attempt += newNumbers[best];
- met[best] = TRUE;
+ met[best] = true;
for ( k = 0; k < p; k++ )
matchedYet[k] = 0;
break;