diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-05-30 14:27:29 +0900 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-06-25 16:43:08 +0900 |
| commit | 35ced32e331ee29fda1642616c803637952f5b22 (patch) | |
| tree | da44726777f814e19c7ef1e43854f6a1693dd6fb /tools/linguist/shared | |
| parent | 7dd4848d61e4c52091d6c644356c84c67536bde2 (diff) | |
| download | tqt-35ced32e.tar.gz tqt-35ced32e.zip | |
Replace TRUE/FALSE with boolean values true/false - part 1
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit a7f1e6e2552d9cdbb3d76bff089db522248b9a24)
Diffstat (limited to 'tools/linguist/shared')
| -rw-r--r-- | tools/linguist/shared/metatranslator.cpp | 44 | ||||
| -rw-r--r-- | tools/linguist/shared/metatranslator.h | 4 |
2 files changed, 24 insertions, 24 deletions
diff --git a/tools/linguist/shared/metatranslator.cpp b/tools/linguist/shared/metatranslator.cpp index 3ea91f2cb..7733f46bc 100644 --- a/tools/linguist/shared/metatranslator.cpp +++ b/tools/linguist/shared/metatranslator.cpp @@ -51,7 +51,7 @@ static bool encodingIsUtf8( const TQXmlAttributes& atts ) return ( atts.value(i) == TQString("UTF-8") ); } } - return FALSE; + return false; } class TsHandler : public TQXmlDefaultHandler @@ -59,8 +59,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, @@ -112,7 +112,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 ); @@ -132,7 +132,7 @@ bool TsHandler::startElement( const TQString& /* namespaceURI */, } accum.truncate( 0 ); } - return TRUE; + return true; } bool TsHandler::endElement( const TQString& /* namespaceURI */, @@ -153,12 +153,12 @@ bool TsHandler::endElement( const TQString& /* namespaceURI */, if ( contextIsUtf8 ) tor->insert( MetaTranslatorMessage(context.utf8(), ContextComment, - accum.utf8(), TQString::null, TRUE, + accum.utf8(), TQString::null, true, MetaTranslatorMessage::Unfinished) ); else tor->insert( MetaTranslatorMessage(context.ascii(), ContextComment, - accum.ascii(), TQString::null, FALSE, + accum.ascii(), TQString::null, false, MetaTranslatorMessage::Unfinished) ); } } else if ( qName == TQString("translation") ) { @@ -167,14 +167,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.ascii(), source.ascii(), comment.ascii(), translation, - FALSE, type) ); - inMessage = FALSE; + false, type) ); + inMessage = false; } - return TRUE; + return true; } bool TsHandler::characters( const TQString& ch ) @@ -182,7 +182,7 @@ bool TsHandler::characters( const TQString& ch ) TQString t = ch; t.replace( "\r", "" ); accum += t; - return TRUE; + return true; } bool TsHandler::fatalError( const TQXmlParseException& exception ) @@ -198,7 +198,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 ) @@ -257,7 +257,7 @@ static TQString evilBytes( const TQCString& str, bool utf8 ) } MetaTranslatorMessage::MetaTranslatorMessage() - : utfeight( FALSE ), ty( Unfinished ) + : utfeight( false ), ty( Unfinished ) { } @@ -267,7 +267,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 @@ -279,7 +279,7 @@ MetaTranslatorMessage::MetaTranslatorMessage( const char *context, int i = 0; while ( sourceText[i] != '\0' ) { if ( (uchar) sourceText[i] >= 0x80 ) { - utfeight = TRUE; + utfeight = true; break; } i++; @@ -289,7 +289,7 @@ MetaTranslatorMessage::MetaTranslatorMessage( const char *context, int i = 0; while ( comment[i] != '\0' ) { if ( (uchar) comment[i] >= 0x80 ) { - utfeight = TRUE; + utfeight = true; break; } i++; @@ -358,13 +358,13 @@ 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; - 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 ); TQXmlDefaultHandler *hand = new TsHandler( this ); reader.setContentHandler( hand ); reader.setErrorHandler( hand ); @@ -381,7 +381,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") ); @@ -448,7 +448,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, diff --git a/tools/linguist/shared/metatranslator.h b/tools/linguist/shared/metatranslator.h index 4462a77f5..3f74aa11e 100644 --- a/tools/linguist/shared/metatranslator.h +++ b/tools/linguist/shared/metatranslator.h @@ -50,7 +50,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 ); @@ -86,7 +86,7 @@ public: void clear(); bool load( const TQString& filename ); bool save( const TQString& filename ) const; - bool release( const TQString& filename, bool verbose = FALSE, + bool release( const TQString& filename, bool verbose = false, TQTranslator::SaveMode mode = TQTranslator::Stripped ) const; bool contains( const char *context, const char *sourceText, |
