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 | |
| 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')
21 files changed, 252 insertions, 252 deletions
diff --git a/tools/linguist/linguist/finddialog.cpp b/tools/linguist/linguist/finddialog.cpp index 3978b974c..005b5a590 100644 --- a/tools/linguist/linguist/finddialog.cpp +++ b/tools/linguist/linguist/finddialog.cpp @@ -57,7 +57,7 @@ FindDialog::FindDialog( bool replace, TQWidget *parent, const char *name, TQLabel *replaceWith = 0; TQPushButton *findNxt = new TQPushButton( tr("&Find Next"), this, "find next" ); - findNxt->setDefault( TRUE ); + findNxt->setDefault( true ); connect( findNxt, TQ_SIGNAL(clicked()), this, TQ_SLOT(emitFindNext()) ); TQPushButton *cancel = new TQPushButton( tr("Cancel"), this, "cancel find" ); connect( cancel, TQ_SIGNAL(clicked()), this, TQ_SLOT(reject()) ); @@ -66,7 +66,7 @@ FindDialog::FindDialog( bool replace, TQWidget *parent, const char *name, bl->addWidget( findNxt ); matchCase = new TQCheckBox( tr("&Match case"), this, "find match case" ); - matchCase->setChecked( FALSE ); + matchCase->setChecked( false ); if ( replace ) { TQWhatsThis::add( this, tr("This window allows you to search and replace" @@ -109,12 +109,12 @@ FindDialog::FindDialog( bool replace, TQWidget *parent, const char *name, sourceText = new TQCheckBox( tr("&Source texts"), this, "find in source texts" ); - sourceText->setChecked( TRUE ); + sourceText->setChecked( true ); translations = new TQCheckBox( tr("&Translations"), this, "find in translations" ); - translations->setChecked( TRUE ); + translations->setChecked( true ); comments = new TQCheckBox( tr("&Comments"), this, "find in comments" ); - comments->setChecked( TRUE ); + comments->setChecked( true ); TQWhatsThis::add( sourceText, tr("Source texts are searched when" " checked.") ); @@ -174,10 +174,10 @@ void FindDialog::emitFindNext() void FindDialog::emitReplace() { - emit replace( led->text(), red->text(), matchCase->isChecked(), FALSE ); + emit replace( led->text(), red->text(), matchCase->isChecked(), false ); } void FindDialog::emitReplaceAll() { - emit replace( led->text(), red->text(), matchCase->isChecked(), TRUE ); + emit replace( led->text(), red->text(), matchCase->isChecked(), true ); } diff --git a/tools/linguist/linguist/finddialog.h b/tools/linguist/linguist/finddialog.h index c2576002e..315748859 100644 --- a/tools/linguist/linguist/finddialog.h +++ b/tools/linguist/linguist/finddialog.h @@ -45,7 +45,7 @@ class FindDialog : public TQDialog public: enum { SourceText = 0x1, Translations = 0x2, Comments = 0x4 }; - FindDialog( bool replace, TQWidget *parent = 0, const char *name = 0, bool modal = FALSE ); + FindDialog( bool replace, TQWidget *parent = 0, const char *name = 0, bool modal = false ); signals: void findNext( const TQString& text, int where, bool matchCase ); diff --git a/tools/linguist/linguist/listviews.cpp b/tools/linguist/linguist/listviews.cpp index 4acfb5051..4eaa2cb1d 100644 --- a/tools/linguist/linguist/listviews.cpp +++ b/tools/linguist/linguist/listviews.cpp @@ -148,11 +148,11 @@ MessageLVI::MessageLVI( TQListView *parent, m.setTranslation( t ); } setText( 1, fixEllipsis( text, Text0MaxLen ) ); - fini = TRUE; - d = FALSE; + fini = true; + d = false; if( m.type() == MetaTranslatorMessage::Unfinished ) - setFinished( FALSE ); + setFinished( false ); } void MessageLVI::updateTranslationText() @@ -241,7 +241,7 @@ MetaTranslatorMessage MessageLVI::message() const ContextLVI::ContextLVI( TQListView *lv, const TQString& context ) : LVI( lv ), com( "" ) { - messageItems.setAutoDelete( TRUE ); + messageItems.setAutoDelete( true ); unfinishedCount = 0; dangerCount = 0; diff --git a/tools/linguist/linguist/listviews.h b/tools/linguist/linguist/listviews.h index 62bc42943..5bc85b31a 100644 --- a/tools/linguist/linguist/listviews.h +++ b/tools/linguist/linguist/listviews.h @@ -48,7 +48,7 @@ public: LVI( TQListViewItem *parent, TQString text = TQString::null ); virtual int compare( TQListViewItem *other, int column, bool ascending ) const; - virtual bool danger() const { return FALSE; } + virtual bool danger() const { return false; } protected: void drawObsoleteText( TQPainter * p, const TQColorGroup & cg, int column, diff --git a/tools/linguist/linguist/main.cpp b/tools/linguist/linguist/main.cpp index 927047769..2f7fae0e3 100644 --- a/tools/linguist/linguist/main.cpp +++ b/tools/linguist/linguist/main.cpp @@ -52,7 +52,7 @@ int main( int argc, char **argv ) translator.load( TQString( "linguist_" ) + TQTextCodec::locale(), "." ); app.installTranslator( &translator ); - bool showSplash = TRUE; + bool showSplash = true; TQString keybase("/TQt Linguist/3.1/"); TQSettings config; @@ -77,7 +77,7 @@ int main( int argc, char **argv ) if ( app.argc() > 1 ) tw->openFile( TQString(app.argv()[app.argc() - 1]) ); - if ( config.readBoolEntry( keybase + "Geometry/MainwindowMaximized", FALSE ) ) + if ( config.readBoolEntry( keybase + "Geometry/MainwindowMaximized", false ) ) tw->showMaximized(); else tw->show(); diff --git a/tools/linguist/linguist/msgedit.cpp b/tools/linguist/linguist/msgedit.cpp index 5d2a785ea..1268847a1 100644 --- a/tools/linguist/linguist/msgedit.cpp +++ b/tools/linguist/linguist/msgedit.cpp @@ -148,7 +148,7 @@ void ShadowWidget::setWidget( TQWidget * child ) { childWgt = child; if ( childWgt && childWgt->parent() != this ) { - childWgt->reparent( this, TQPoint( 0, 0 ), TRUE ); + childWgt->reparent( this, TQPoint( 0, 0 ), true ); } } @@ -220,7 +220,7 @@ EditorPage::EditorPage( TQWidget * parent, const char * name ) transLbl = new TQLabel( tr("Translation"), this, "translation label" ); TQFont fnt = font(); - fnt.setBold( TRUE ); + fnt.setBold( true ); srcTextLbl->setFont( fnt ); transLbl->setFont( fnt ); @@ -381,7 +381,7 @@ void EditorPage::fontChange( const TQFont & ) { TQFont fnt = font(); - fnt.setBold( TRUE ); + fnt.setBold( true ); TQFontMetrics fm( fnt ); srcTextLbl->setFont( fnt ); srcTextLbl->resize( fm.width( srcTextLbl->text() ), srcTextLbl->height() ); @@ -400,7 +400,7 @@ MessageEditor::MessageEditor( MetaTranslator * t, TQWidget * parent, : TQWidget( parent, name ), tor( t ) { - doGuesses = TRUE; + doGuesses = true; v = new TQVBoxLayout( this ); topDock = new TQDockArea( TQt::Horizontal, TQDockArea::Normal, this, "top dock area" ); @@ -412,20 +412,20 @@ MessageEditor::MessageEditor( MetaTranslator * t, TQWidget * parent, "top dock window" ); TQMainWindow *mw = (TQMainWindow*)topLevelWidget(); if ( mw ) { - mw->setDockEnabled( topDockWnd, TQt::DockTop, TRUE ); - mw->setDockEnabled( topDockWnd, TQt::DockLeft, TRUE ); - mw->setDockEnabled( topDockWnd, TQt::DockRight, TRUE ); - mw->setDockEnabled( topDockWnd, TQt::DockBottom, TRUE ); + mw->setDockEnabled( topDockWnd, TQt::DockTop, true ); + mw->setDockEnabled( topDockWnd, TQt::DockLeft, true ); + mw->setDockEnabled( topDockWnd, TQt::DockRight, true ); + mw->setDockEnabled( topDockWnd, TQt::DockBottom, true ); } topDockWnd->setCaption( tr("Source text") ); topDockWnd->setCloseMode( TQDockWindow::Always ); - topDockWnd->setResizeEnabled( TRUE ); + topDockWnd->setResizeEnabled( true ); topDockWnd->setFixedExtentHeight( 110 ); srcTextList = new TQListView( topDockWnd, "source text list view" ); - srcTextList->setShowSortIndicator( TRUE ); - srcTextList->setAllColumnsShowFocus( TRUE ); + srcTextList->setShowSortIndicator( true ); + srcTextList->setAllColumnsShowFocus( true ); srcTextList->setSorting( 0 ); TQFontMetrics fm( font() ); srcTextList->addColumn( tr("Done"), fm.width( tr("Done") ) + 10 ); @@ -433,7 +433,7 @@ MessageEditor::MessageEditor( MetaTranslator * t, TQWidget * parent, srcTextList->addColumn( tr("Translation"), 300 ); srcTextList->setColumnAlignment( 0, TQt::AlignCenter ); srcTextList->setColumnWidthMode( 1, TQListView::Manual ); - srcTextList->header()->setStretchEnabled( TRUE, 1 ); + srcTextList->header()->setStretchEnabled( true, 1 ); srcTextList->setMinimumSize( TQSize( 50, 50 ) ); srcTextList->setHScrollBarMode( TQScrollView::AlwaysOff ); srcTextList->installEventFilter( this ); @@ -463,14 +463,14 @@ MessageEditor::MessageEditor( MetaTranslator * t, TQWidget * parent, bottomDockWnd = new TQDockWindow( TQDockWindow::InDock, bottomDock, "bottom dock window" ); if ( mw ) { - mw->setDockEnabled( bottomDockWnd, TQt::DockTop, TRUE ); - mw->setDockEnabled( bottomDockWnd, TQt::DockLeft, TRUE ); - mw->setDockEnabled( bottomDockWnd, TQt::DockRight, TRUE ); - mw->setDockEnabled( bottomDockWnd, TQt::DockBottom, TRUE ); + mw->setDockEnabled( bottomDockWnd, TQt::DockTop, true ); + mw->setDockEnabled( bottomDockWnd, TQt::DockLeft, true ); + mw->setDockEnabled( bottomDockWnd, TQt::DockRight, true ); + mw->setDockEnabled( bottomDockWnd, TQt::DockBottom, true ); } bottomDockWnd->setCaption( tr("Phrases") ); bottomDockWnd->setCloseMode( TQDockWindow::Always ); - bottomDockWnd->setResizeEnabled( TRUE ); + bottomDockWnd->setResizeEnabled( true ); TQWidget * w = new TQWidget( bottomDockWnd ); w->setSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, @@ -538,9 +538,9 @@ MessageEditor::MessageEditor( MetaTranslator * t, TQWidget * parent, void MessageEditor::toggleFinished() { if ( itemFinished ) - itemFinished = FALSE; + itemFinished = false; else - itemFinished = TRUE; + itemFinished = true; emit finished( itemFinished ); } @@ -558,7 +558,7 @@ bool MessageEditor::eventFilter( TQObject *o, TQEvent *e ) // inside the editor if ( k == Key_BackTab ) { emit focusSourceList(); - return TRUE; + return true; } } else if ( e->type() == TQEvent::KeyRelease ) { MED * ed = (MED *) o; @@ -620,12 +620,12 @@ TQListView * MessageEditor::phraseList() const void MessageEditor::showNothing() { editorPage->srcText->setText( "" ); - showContext( TQString(""), FALSE ); + showContext( TQString(""), false ); } void MessageEditor::showContext( const TQString& context, bool finished ) { - setEditionEnabled( FALSE ); + setEditionEnabled( false ); sourceText = TQString::null; guesses.clear(); @@ -633,7 +633,7 @@ void MessageEditor::showContext( const TQString& context, bool finished ) editorPage->cmtText->setText(""); else editorPage->cmtText->setText( richText(context.simplifyWhiteSpace()) ); - setTranslation( TQString(""), FALSE ); + setTranslation( TQString(""), false ); setFinished( finished ); phraseLv->clear(); editorPage->handleSourceChanges(); @@ -667,7 +667,7 @@ void MessageEditor::showMessage( const TQString& text, else editorPage->cmtText->setText( "" ); - setTranslation( translation, FALSE ); + setTranslation( translation, false ); setFinished( type != MetaTranslatorMessage::Unfinished ); TQValueList<Phrase>::ConstIterator p; phraseLv->clear(); @@ -706,11 +706,11 @@ void MessageEditor::setTranslation( const TQString& translation, bool emitt ) // the actual translation. editorPage->translationMed->blockSignals( !emitt ); editorPage->translationMed->setText( translation ); - editorPage->translationMed->blockSignals( FALSE ); + editorPage->translationMed->blockSignals( false ); if ( !emitt ) updateButtons(); - emit cutAvailable( FALSE ); - emit copyAvailable( FALSE ); + emit cutAvailable( false ); + emit copyAvailable( false ); } void MessageEditor::setEditionEnabled( bool enabled ) @@ -790,21 +790,21 @@ void MessageEditor::updateButtons() bool overwrite = ( !editorPage->translationMed->isReadOnly() && (editorPage->translationMed->text().stripWhiteSpace().isEmpty() || mayOverwriteTranslation) ); - mayOverwriteTranslation = FALSE; + mayOverwriteTranslation = false; emit updateActions( overwrite ); } void MessageEditor::beginFromSource() { - mayOverwriteTranslation = TRUE; - setTranslation( sourceText, TRUE ); + mayOverwriteTranslation = true; + setTranslation( sourceText, true ); if ( !editorPage->hasFocus() ) editorPage->setFocus(); } void MessageEditor::finishAndNext() { - setFinished( TRUE ); + setFinished( true ); emit nextUnfinished(); if ( !editorPage->hasFocus() ) editorPage->setFocus(); diff --git a/tools/linguist/linguist/phrase.cpp b/tools/linguist/linguist/phrase.cpp index 0a93e89b8..f2b5a458f 100644 --- a/tools/linguist/linguist/phrase.cpp +++ b/tools/linguist/linguist/phrase.cpp @@ -99,7 +99,7 @@ bool QphHandler::startElement( const TQString& /* namespaceURI */, definition.truncate( 0 ); } accum.truncate( 0 ); - return TRUE; + return true; } bool QphHandler::endElement( const TQString& /* namespaceURI */, @@ -114,13 +114,13 @@ bool QphHandler::endElement( const TQString& /* namespaceURI */, definition = accum; else if ( qName == TQString("phrase") ) pb->append( Phrase(source, target, definition) ); - return TRUE; + return true; } bool QphHandler::characters( const TQString& ch ) { accum += ch; - return TRUE; + return true; } bool QphHandler::fatalError( const TQXmlParseException& exception ) @@ -133,23 +133,23 @@ bool QphHandler::fatalError( const TQXmlParseException& exception ) TQMessageBox::information( tqApp->mainWidget(), TQObject::tr("TQt Linguist"), msg ); } - return FALSE; + return false; } bool PhraseBook::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 QphHandler( this ); reader.setContentHandler( hand ); reader.setErrorHandler( hand ); @@ -168,7 +168,7 @@ bool PhraseBook::save( const TQString& filename ) const { TQFile f( filename ); if ( !f.open(IO_WriteOnly) ) - return FALSE; + return false; TQTextStream t( &f ); t.setEncoding(TQTextStream::UnicodeUTF8); @@ -185,5 +185,5 @@ bool PhraseBook::save( const TQString& filename ) const } t << "</TQPH>\n"; f.close(); - return TRUE; + return true; } diff --git a/tools/linguist/linguist/phrasebookbox.cpp b/tools/linguist/linguist/phrasebookbox.cpp index cefac1b34..67106bceb 100644 --- a/tools/linguist/linguist/phrasebookbox.cpp +++ b/tools/linguist/linguist/phrasebookbox.cpp @@ -69,10 +69,10 @@ PhraseBookBox::PhraseBookBox( const TQString& filename, lv = new PhraseLV( this, "phrase book list view" ); newBut = new TQPushButton( tr("&New Phrase"), this ); - newBut->setDefault( TRUE ); + newBut->setDefault( true ); removeBut = new TQPushButton( tr("&Remove Phrase"), this ); - removeBut->setEnabled( FALSE ); + removeBut->setEnabled( false ); TQPushButton *saveBut = new TQPushButton( tr("&Save"), this ); TQPushButton *closeBut = new TQPushButton( tr("Close"), this ); @@ -208,7 +208,7 @@ void PhraseBookBox::selectionChanged( TQListViewItem * /* item */ ) void PhraseBookBox::selectItem( TQListViewItem *item ) { - lv->setSelected( item, TRUE ); + lv->setSelected( item, true ); lv->ensureItemVisible( item ); } @@ -216,9 +216,9 @@ void PhraseBookBox::enableDisable() { TQListViewItem *item = lv->currentItem(); - sourceLed->blockSignals( TRUE ); - targetLed->blockSignals( TRUE ); - definitionLed->blockSignals( TRUE ); + sourceLed->blockSignals( true ); + targetLed->blockSignals( true ); + definitionLed->blockSignals( true ); if ( item == 0 ) { sourceLed->setText( TQString::null ); @@ -234,9 +234,9 @@ void PhraseBookBox::enableDisable() definitionLed->setEnabled( item != 0 ); removeBut->setEnabled( item != 0 ); - sourceLed->blockSignals( FALSE ); - targetLed->blockSignals( FALSE ); - definitionLed->blockSignals( FALSE ); + sourceLed->blockSignals( false ); + targetLed->blockSignals( false ); + definitionLed->blockSignals( false ); TQLineEdit *led = ( sourceLed->text() == NewPhrase ? sourceLed : targetLed ); led->setFocus(); diff --git a/tools/linguist/linguist/phrasebookbox.h b/tools/linguist/linguist/phrasebookbox.h index 99edb9f81..e93383920 100644 --- a/tools/linguist/linguist/phrasebookbox.h +++ b/tools/linguist/linguist/phrasebookbox.h @@ -51,7 +51,7 @@ class PhraseBookBox : public TQDialog public: PhraseBookBox( const TQString& filename, const PhraseBook& phraseBook, TQWidget *parent = 0, const char *name = 0, - bool modal = FALSE ); + bool modal = false ); const PhraseBook& phraseBook() const { return pb; } diff --git a/tools/linguist/linguist/phraselv.cpp b/tools/linguist/linguist/phraselv.cpp index 92757cd84..76de52663 100644 --- a/tools/linguist/linguist/phraselv.cpp +++ b/tools/linguist/linguist/phraselv.cpp @@ -149,14 +149,14 @@ TQString PhraseLVI::makeKey( const TQString& text ) const PhraseLV::PhraseLV( TQWidget *parent, const char *name ) : TQListView( parent, name ) { - setAllColumnsShowFocus( TRUE ); - setShowSortIndicator( TRUE ); + setAllColumnsShowFocus( true ); + setShowSortIndicator( true ); for ( int i = 0; i < 3; i++ ) addColumn( TQString::null, 120 ); setColumnText( PhraseLVI::SourceTextShown, tr("Source phrase") ); setColumnText( PhraseLVI::TargetTextShown, tr("Translation") ); setColumnText( PhraseLVI::DefinitionText, tr("Definition") ); - header()->setStretchEnabled( TRUE, -1 ); + header()->setStretchEnabled( true, -1 ); what = new WhatPhrase( this ); } diff --git a/tools/linguist/linguist/printout.cpp b/tools/linguist/linguist/printout.cpp index 321e8de2d..e1eb58949 100644 --- a/tools/linguist/linguist/printout.cpp +++ b/tools/linguist/linguist/printout.cpp @@ -99,7 +99,7 @@ void PrintOut::flushLine( bool /* mayBreak */ ) nextRule = NoRule; cp = Paragraph( TQPoint(hmargin, voffset) ); - firstParagraph = FALSE; + firstParagraph = false; } void PrintOut::addBox( int percent, const TQString& text, Style style, @@ -108,9 +108,9 @@ void PrintOut::addBox( int percent, const TQString& text, Style style, int align = halign | TQt::AlignTop; TQFont f = f10; if ( style == Strong ) - f.setBold( TRUE ); + f.setBold( true ); else if ( style == Emphasis ) - f.setItalic( TRUE ); + f.setItalic( true ); int wd = hsize * percent / 100; TQRect r( cp.rect.x() + cp.rect.width(), 0, wd, vsize ); int ht = p.boundingRect( r, align, text ).height(); @@ -151,7 +151,7 @@ void PrintOut::breakPage() voffset += 4; p.drawLine( TQPoint(hmargin, voffset), TQPoint(hmargin + hsize, voffset) ); voffset += 14; - firstParagraph = TRUE; + firstParagraph = true; } void PrintOut::drawRule( Rule rule ) diff --git a/tools/linguist/linguist/printout.h b/tools/linguist/linguist/printout.h index bba3da6af..e8c61c9ee 100644 --- a/tools/linguist/linguist/printout.h +++ b/tools/linguist/linguist/printout.h @@ -56,7 +56,7 @@ public: void setRule( Rule rule ); void setGuide( const TQString& guide ); void vskip(); - void flushLine( bool mayBreak = FALSE ); + void flushLine( bool mayBreak = false ); void addBox( int percent, const TQString& text = TQString::null, Style style = Normal, int halign = TQt::AlignLeft | TQt::WordBreak ); diff --git a/tools/linguist/linguist/trwindow.cpp b/tools/linguist/linguist/trwindow.cpp index 7b3ce9880..b95aad30e 100644 --- a/tools/linguist/linguist/trwindow.cpp +++ b/tools/linguist/linguist/trwindow.cpp @@ -163,9 +163,9 @@ class Action : public TQAction public: Action( TQPopupMenu *pop, const TQString& menuText, TQObject *receiver, const char *member, const TQString &imageName = TQString::null, - int accel = 0, bool toggle = FALSE ); + int accel = 0, bool toggle = false ); Action( TQPopupMenu *pop, const TQString& menuText, int accel = 0, - bool toggle = FALSE ); + bool toggle = false ); virtual void setWhatsThis( const TQString& whatsThis ); @@ -220,7 +220,7 @@ const TQPixmap TrWindow::pageCurl() pixmap = TQPixmap::fromMimeSource( "pagecurl.png" ); if ( !pixmap.isNull() ) { TQBitmap pageCurlMask( pagecurl_mask_width, pagecurl_mask_height, - pagecurl_mask_bits, TRUE ); + pagecurl_mask_bits, true ); pixmap.setMask( pageCurlMask ); } @@ -244,15 +244,15 @@ TrWindow::TrWindow() // Set up the Scope dock window TQDockWindow * dwScope = new TQDockWindow( TQDockWindow::InDock, this, "context"); - dwScope->setResizeEnabled( TRUE ); + dwScope->setResizeEnabled( true ); dwScope->setCloseMode( TQDockWindow::Always ); addDockWindow( dwScope, tr("Context"), TQt::DockLeft ); dwScope->setCaption( tr("Context") ); dwScope->setFixedExtentWidth( 200 ); lv = new TQListView( dwScope, "context list view" ); - lv->setShowSortIndicator( TRUE ); - lv->setAllColumnsShowFocus( TRUE ); - lv->header()->setStretchEnabled( TRUE, 1 ); + lv->setShowSortIndicator( true ); + lv->setAllColumnsShowFocus( true ); + lv->header()->setStretchEnabled( true, 1 ); TQFontMetrics fm( font() ); lv->addColumn( tr("Done"), fm.width( tr("Done") ) + 10 ); lv->addColumn( tr("Context") ); @@ -263,7 +263,7 @@ TrWindow::TrWindow() lv->setHScrollBarMode( TQScrollView::AlwaysOff ); dwScope->setWidget( lv ); - messageIsShown = FALSE; + messageIsShown = false; me = new MessageEditor( &tor, this, "message editor" ); setCentralWidget( me ); slv = me->sourceTextList(); @@ -273,10 +273,10 @@ TrWindow::TrWindow() setupToolBars(); progress = new TQLabel( statusBar(), "progress" ); - statusBar()->addWidget( progress, 0, TRUE ); + statusBar()->addWidget( progress, 0, true ); modified = new TQLabel( TQString(" %1 ").arg(tr("MOD")), statusBar(), "modified?" ); - statusBar()->addWidget( modified, 0, TRUE ); + statusBar()->addWidget( modified, 0, true ); dirtyItem = -1; numFinished = 0; @@ -284,16 +284,16 @@ TrWindow::TrWindow() numMessages = 0; updateProgress(); - dirty = FALSE; + dirty = false; updateCaption(); - phraseBooks.setAutoDelete( TRUE ); + phraseBooks.setAutoDelete( true ); - f = new FindDialog( FALSE, this, "find", FALSE ); + f = new FindDialog( false, this, "find", false ); f->setCaption( tr("TQt Linguist") ); - h = new FindDialog( TRUE, this, "replace", FALSE ); + h = new FindDialog( true, this, "replace", false ); h->setCaption( tr("TQt Linguist") ); - findMatchCase = FALSE; + findMatchCase = false; findWhere = 0; foundItem = 0; foundScope = 0; @@ -355,14 +355,14 @@ void TrWindow::openFile( const TQString& name ) slv->clear(); slv->repaint(); slv->viewport()->repaint(); - slv->setUpdatesEnabled( FALSE ); - slv->viewport()->setUpdatesEnabled( FALSE ); + slv->setUpdatesEnabled( false ); + slv->viewport()->setUpdatesEnabled( false ); lv->clear(); lv->repaint(); lv->viewport()->repaint(); - lv->setUpdatesEnabled( FALSE ); - lv->viewport()->setUpdatesEnabled( FALSE ); - setEnabled( FALSE ); + lv->setUpdatesEnabled( false ); + lv->viewport()->setUpdatesEnabled( false ); + setEnabled( false ); numFinished = 0; numNonobsolete = 0; numMessages = 0; @@ -409,22 +409,22 @@ void TrWindow::openFile( const TQString& name ) } c->updateStatus(); } - slv->viewport()->setUpdatesEnabled( TRUE ); - slv->setUpdatesEnabled( TRUE ); - lv->viewport()->setUpdatesEnabled( TRUE ); - lv->setUpdatesEnabled( TRUE ); - setEnabled( TRUE ); + slv->viewport()->setUpdatesEnabled( true ); + slv->setUpdatesEnabled( true ); + lv->viewport()->setUpdatesEnabled( true ); + lv->setUpdatesEnabled( true ); + setEnabled( true ); slv->repaint(); slv->viewport()->repaint(); lv->triggerUpdate(); updateProgress(); filename = name; - dirty = FALSE; + dirty = false; updateCaption(); me->showNothing(); - doneAndNextAct->setEnabled( FALSE ); - doneAndNextAlt->setEnabled( FALSE ); - messageIsShown = FALSE; + doneAndNextAct->setEnabled( false ); + doneAndNextAlt->setEnabled( false ); + messageIsShown = false; statusBar()->message( tr("%1 source phrase(s) loaded.").arg(numMessages), MessageMS ); @@ -433,10 +433,10 @@ void TrWindow::openFile( const TQString& name ) foundWhere = 0; foundOffset = 0; if ( lv->childCount() > 0 ) { - findAct->setEnabled( TRUE ); - findAgainAct->setEnabled( FALSE ); + findAct->setEnabled( true ); + findAgainAct->setEnabled( false ); #ifdef notyet - replaceAct->setEnabled( TRUE ); + replaceAct->setEnabled( true ); #endif lv->setCurrentItem( lv->firstChild() ); } @@ -467,7 +467,7 @@ void TrWindow::save() return; if ( tor.save(filename) ) { - dirty = FALSE; + dirty = false; updateCaption(); statusBar()->message( tr("File saved."), MessageMS ); } else { @@ -560,7 +560,7 @@ void TrWindow::print() pout.addBox( 4 ); pout.addBox( 92, m->comment(), PrintOut::Emphasis ); } - pout.flushLine( TRUE ); + pout.flushLine( true ); if ( pout.pageNum() != pageNum ) { pageNum = pout.pageNum(); @@ -571,7 +571,7 @@ void TrWindow::print() } c = (ContextLVI *) c->nextSibling(); } - pout.flushLine( TRUE ); + pout.flushLine( true ); TQApplication::restoreOverrideCursor(); statusBar()->message( tr("Printing completed"), MessageMS ); } else { @@ -607,7 +607,7 @@ void TrWindow::findAgain() #else foundOffset++; #endif - slv->setUpdatesEnabled( FALSE ); + slv->setUpdatesEnabled( false ); do { // Iterate through every item in all contexts if ( j == 0 ) { @@ -680,7 +680,7 @@ void TrWindow::findAgain() setCurrentMessageItem( slv->firstChild() ); } - slv->setUpdatesEnabled( TRUE ); + slv->setUpdatesEnabled( true ); slv->triggerUpdate(); tqApp->beep(); TQMessageBox::warning( this, tr("TQt Linguist"), @@ -734,13 +734,13 @@ bool TrWindow::searchItem( const TQString & searchWhat, TQListViewItem * j, foundItem = itemToIndex( slv, k ); foundScope = j; setCurrentMessageItem( k ); - slv->setUpdatesEnabled( TRUE ); + slv->setUpdatesEnabled( true ); slv->triggerUpdate(); - return TRUE; + return true; } } foundOffset = 0; - return FALSE; + return false; } void TrWindow::newPhraseBook() @@ -800,7 +800,7 @@ void TrWindow::editPhraseBook( int id ) { int index = editPhraseBookp->indexOf( id ); PhraseBookBox box( phraseBookNames[index], *phraseBooks.at(index), this, - "phrase book box", TRUE ); + "phrase book box", true ); box.setCaption( tr("%1 - %2").arg(tr("TQt Linguist")) .arg(friendlyPhraseBookName(index)) ); box.resize( 500, 300 ); @@ -835,9 +835,9 @@ void TrWindow::printPhraseBook( int id ) .arg(pageNum) ); } pout.setRule( PrintOut::NoRule ); - pout.flushLine( TRUE ); + pout.flushLine( true ); } - pout.flushLine( TRUE ); + pout.flushLine( true ); statusBar()->message( tr("Printing completed"), MessageMS ); } else { statusBar()->message( tr("Printing aborted"), MessageMS ); @@ -858,7 +858,7 @@ void TrWindow::manual() void TrWindow::about() { - AboutDialog about( this, 0, TRUE ); + AboutDialog about( this, 0, true ); about.versionLabel->setText( tr("Version %1").arg(TQT_VERSION_STR) ); about.exec(); } @@ -895,7 +895,7 @@ bool TrWindow::maybeSave() TQMessageBox::Cancel | TQMessageBox::Escape ) ) { case TQMessageBox::Cancel: - return FALSE; + return false; case TQMessageBox::Yes: save(); return !dirty; @@ -903,7 +903,7 @@ bool TrWindow::maybeSave() break; } } - return TRUE; + return true; } void TrWindow::updateCaption() @@ -939,14 +939,14 @@ void TrWindow::showNewScope( TQListViewItem *item ) if( item != 0 ) { ContextLVI * c = (ContextLVI *) item; bool upe = slv->isUpdatesEnabled(); - slv->setUpdatesEnabled( FALSE ); - slv->viewport()->setUpdatesEnabled( FALSE ); + slv->setUpdatesEnabled( false ); + slv->viewport()->setUpdatesEnabled( false ); if ( oldContext != 0 ) { MessageLVI * tmp; - slv->blockSignals( TRUE ); + slv->blockSignals( true ); while ( (tmp = (MessageLVI *) slv->firstChild()) != 0 ) oldContext->appendMessageItem( slv, tmp ); - slv->blockSignals( FALSE ); + slv->blockSignals( false ); } MessageLVI * tmp; while ( c->messageItemsInList() ) { @@ -980,7 +980,7 @@ void TrWindow::showNewCurrent( TQListViewItem *item ) getPhrases(m->sourceText()) ); if ( (m->message().type() != MetaTranslatorMessage::Finished) && m->danger() ) - danger( m->sourceText(), m->translation(), TRUE ); + danger( m->sourceText(), m->translation(), true ); else statusBar()->clear(); @@ -991,7 +991,7 @@ void TrWindow::showNewCurrent( TQListViewItem *item ) me->showNothing(); else me->showContext( c->fullContext(), c->finished() ); - doneAndNextAct->setEnabled( FALSE ); + doneAndNextAct->setEnabled( false ); } doneAndNextAlt->setEnabled( doneAndNextAct->isEnabled() ); @@ -1007,16 +1007,16 @@ void TrWindow::updateTranslation( const TQString& translation ) bool dngr; m->setTranslation( translation ); if ( m->finished() && - (dngr = danger( m->sourceText(), m->translation(), TRUE )) ) { + (dngr = danger( m->sourceText(), m->translation(), true )) ) { numFinished -= 1; m->setDanger( dngr ); - m->setFinished( FALSE ); + m->setFinished( false ); m->contextLVI()->updateStatus(); updateProgress(); } tor.insert( m->message() ); if ( !dirty ) { - dirty = TRUE; + dirty = true; updateCaption(); } m->updateTranslationText(); @@ -1041,7 +1041,7 @@ void TrWindow::updateFinished( bool finished ) tqApp->beep(); tor.insert( m->message() ); if ( !dirty ) { - dirty = TRUE; + dirty = true; updateCaption(); } } @@ -1051,10 +1051,10 @@ void TrWindow::updateFinished( bool finished ) void TrWindow::doneAndNext() { MessageLVI * m = (MessageLVI *) slv->currentItem(); - bool dngr = FALSE; + bool dngr = false; if ( !m ) return; - dngr = danger( m->sourceText(), m->translation(), TRUE ); + dngr = danger( m->sourceText(), m->translation(), true ); if ( !dngr ) { me->finishAndNext(); m->contextLVI()->updateStatus(); @@ -1063,7 +1063,7 @@ void TrWindow::doneAndNext() m->setDanger( dngr ); tor.insert( m->message() ); if ( !dirty ) { - dirty = TRUE; + dirty = true; updateCaption(); } tqApp->beep(); @@ -1076,10 +1076,10 @@ void TrWindow::toggleFinished( TQListViewItem *item, const TQPoint& /* p */, { if ( item != 0 && column == 0 ) { MessageLVI *m = (MessageLVI *) item; - bool dngr = FALSE; + bool dngr = false; if ( m->message().type() == MetaTranslatorMessage::Unfinished ) { - dngr = danger( m->sourceText(), m->translation(), TRUE ); + dngr = danger( m->sourceText(), m->translation(), true ); } if ( !dngr && m->message().type() != MetaTranslatorMessage::Obsolete) { setCurrentMessageItem( m ); @@ -1093,7 +1093,7 @@ void TrWindow::toggleFinished( TQListViewItem *item, const TQPoint& /* p */, tqApp->beep(); tor.insert( m->message() ); if ( !dirty ) { - dirty = TRUE; + dirty = true; updateCaption(); } } @@ -1348,7 +1348,7 @@ void TrWindow::findNext( const TQString& text, int where, bool matchCase ) findText = TQString( "magicwordthatyoushouldavoid" ); findWhere = where; findMatchCase = matchCase; - findAgainAct->setEnabled( TRUE ); + findAgainAct->setEnabled( true ); findAgain(); } @@ -1357,7 +1357,7 @@ void TrWindow::revalidate() ContextLVI *c = (ContextLVI *) lv->firstChild(); TQListViewItem * oldScope = lv->currentItem(); int oldItemNo = itemToIndex( slv, slv->currentItem() ); - slv->setUpdatesEnabled( FALSE ); + slv->setUpdatesEnabled( false ); while ( c != 0 ) { showNewScope( c ); @@ -1376,7 +1376,7 @@ void TrWindow::revalidate() if( tmp ) setCurrentMessageItem( tmp ); } - slv->setUpdatesEnabled( TRUE ); + slv->setUpdatesEnabled( true ); slv->triggerUpdate(); } @@ -1397,13 +1397,13 @@ void TrWindow::setupMenuBar() TQPopupMenu * editp = new TQPopupMenu( this ); TQPopupMenu * translationp = new TQPopupMenu( this ); TQPopupMenu * validationp = new TQPopupMenu( this ); - validationp->setCheckable( TRUE ); + validationp->setCheckable( true ); phrasep = new TQPopupMenu( this ); closePhraseBookp = new TQPopupMenu( this ); editPhraseBookp = new TQPopupMenu( this ); printPhraseBookp = new TQPopupMenu( this ); TQPopupMenu * viewp = new TQPopupMenu( this ); - viewp->setCheckable( TRUE ); + viewp->setCheckable( true ); TQPopupMenu * helpp = new TQPopupMenu( this ); m->insertItem( tr("&File"), filep ); @@ -1453,40 +1453,40 @@ void TrWindow::setupMenuBar() // Edit menu undoAct = new Action( editp, tr("&Undo"), me, TQ_SLOT(undo()), "undo.png", TQAccel::stringToKey(tr("Ctrl+Z")) ); - undoAct->setEnabled( FALSE ); + undoAct->setEnabled( false ); connect( me, TQ_SIGNAL(undoAvailable(bool)), undoAct, TQ_SLOT(setEnabled(bool)) ); redoAct = new Action( editp, tr("&Redo"), me, TQ_SLOT(redo()), "redo.png", TQAccel::stringToKey(tr("Ctrl+Y")) ); - redoAct->setEnabled( FALSE ); + redoAct->setEnabled( false ); connect( me, TQ_SIGNAL(redoAvailable(bool)), redoAct, TQ_SLOT(setEnabled(bool)) ); editp->insertSeparator(); cutAct = new Action( editp, tr("Cu&t"), me, TQ_SLOT(cut()), "editcut.png", TQAccel::stringToKey(tr("Ctrl+X")) ); - cutAct->setEnabled( FALSE ); + cutAct->setEnabled( false ); connect( me, TQ_SIGNAL(cutAvailable(bool)), cutAct, TQ_SLOT(setEnabled(bool)) ); copyAct = new Action( editp, tr("&Copy"), me, TQ_SLOT(copy()), "editcopy.png", TQAccel::stringToKey(tr("Ctrl+C")) ); - copyAct->setEnabled( FALSE ); + copyAct->setEnabled( false ); connect( me, TQ_SIGNAL(copyAvailable(bool)), copyAct, TQ_SLOT(setEnabled(bool)) ); pasteAct = new Action( editp, tr("&Paste"), me, TQ_SLOT(paste()), "editpaste.png", TQAccel::stringToKey(tr("Ctrl+V")) ); - pasteAct->setEnabled( FALSE ); + pasteAct->setEnabled( false ); connect( me, TQ_SIGNAL(pasteAvailable(bool)), pasteAct, TQ_SLOT(setEnabled(bool)) ); selectAllAct = new Action( editp, tr("Select &All"), me, TQ_SLOT(selectAll()), TQString::null, TQAccel::stringToKey(tr("Ctrl+A")) ); - selectAllAct->setEnabled( FALSE ); + selectAllAct->setEnabled( false ); editp->insertSeparator(); findAct = new Action( editp, tr("&Find..."), this, TQ_SLOT(find()), "searchfind.png", TQAccel::stringToKey(tr("Ctrl+F")) ); - findAct->setEnabled( FALSE ); + findAct->setEnabled( false ); findAgainAct = new Action( editp, tr("Find &Next"), this, TQ_SLOT(findAgain()), TQString::null, Key_F3 ); - findAgainAct->setEnabled( FALSE ); + findAgainAct->setEnabled( false ); #ifdef notyet replaceAct = new Action( editp, tr("&Replace..."), this, TQ_SLOT(replace()), TQAccel::stringToKey(tr("Ctrl+H")) ); - replaceAct->setEnabled( FALSE ); + replaceAct->setEnabled( false ); #endif // Translation menu @@ -1534,24 +1534,24 @@ void TrWindow::setupMenuBar() // Validation menu acceleratorsAct = new Action( validationp, tr("&Accelerators"), - this, TQ_SLOT(revalidate()), "accelerator.png", 0, TRUE ); - acceleratorsAct->setOn( TRUE ); + this, TQ_SLOT(revalidate()), "accelerator.png", 0, true ); + acceleratorsAct->setOn( true ); endingPunctuationAct = new Action( validationp, tr("&Ending Punctuation"), - this, TQ_SLOT(revalidate()), "punctuation.png", 0, TRUE ); - endingPunctuationAct->setOn( TRUE ); + this, TQ_SLOT(revalidate()), "punctuation.png", 0, true ); + endingPunctuationAct->setOn( true ); phraseMatchesAct = new Action( validationp, tr("&Phrase Matches"), - this, TQ_SLOT(revalidate()), "phrase.png", 0, TRUE ); - phraseMatchesAct->setOn( TRUE ); + this, TQ_SLOT(revalidate()), "phrase.png", 0, true ); + phraseMatchesAct->setOn( true ); // View menu revertSortingAct = new Action( viewp, tr("&Revert Sorting"), this, TQ_SLOT(revertSorting()) ); doGuessesAct = new Action( viewp, tr("&Display guesses"), this, TQ_SLOT(toggleGuessing()) ); - doGuessesAct->setToggleAction( TRUE ); - doGuessesAct->setOn( TRUE ); + doGuessesAct->setToggleAction( true ); + doGuessesAct->setOn( true ); toggleStats = new Action( viewp, tr("&Statistics"), this, TQ_SLOT(toggleStatistics()) ); - toggleStats->setToggleAction( TRUE ); + toggleStats->setToggleAction( true ); viewp->insertSeparator(); viewp->insertItem( tr("Vie&ws"), createDockWindowMenu( NoToolBars ) ); viewp->insertItem( tr("&Toolbars"), createDockWindowMenu( OnlyToolBars ) ); @@ -1676,13 +1676,13 @@ void TrWindow::setupToolBars() void TrWindow::setCurrentContextItem( TQListViewItem *item ) { lv->ensureItemVisible( item ); - lv->setSelected( item, TRUE ); + lv->setSelected( item, true ); } void TrWindow::setCurrentMessageItem( TQListViewItem *item ) { slv->ensureItemVisible( item ); - slv->setSelected( item, TRUE ); + slv->setSelected( item, true ); } TQString TrWindow::friendlyPhraseBookName( int k ) @@ -1697,7 +1697,7 @@ bool TrWindow::openPhraseBook( const TQString& name ) TQMessageBox::warning( this, tr("TQt Linguist"), tr("Cannot read from phrase book '%1'.") .arg(name) ); - return FALSE; + return false; } int index = (int) phraseBooks.count(); @@ -1712,7 +1712,7 @@ bool TrWindow::openPhraseBook( const TQString& name ) printPhraseBookp->setWhatsThis( id, tr("Print the entries of the phrase" " book.") ); updatePhraseDict(); - return TRUE; + return true; } bool TrWindow::savePhraseBook( TQString& name, const PhraseBook& pb ) @@ -1724,9 +1724,9 @@ bool TrWindow::savePhraseBook( TQString& name, const PhraseBook& pb ) TQMessageBox::warning( this, tr("TQt Linguist"), tr("Cannot create phrase book '%1'.") .arg(name) ); - return FALSE; + return false; } - return TRUE; + return true; } void TrWindow::updateProgress() @@ -1796,12 +1796,12 @@ bool TrWindow::danger( const TQString& source, const TQString& translation, if ( verbose ) statusBar()->message( tr("Accelerator possibly superfluous in" " translation."), ErrorMS ); - return TRUE; + return true; } else if ( sk != 0 && tk == 0 ) { if ( verbose ) statusBar()->message( tr("Accelerator possibly missing in" " translation."), ErrorMS ); - return TRUE; + return true; } } if ( endingPunctuationAct->isOn() ) { @@ -1810,7 +1810,7 @@ bool TrWindow::danger( const TQString& source, const TQString& translation, statusBar()->message( tr("Translation does not end with the" " same punctuation as the source" " text."), ErrorMS ); - return TRUE; + return true; } } if ( phraseMatchesAct->isOn() ) { @@ -1833,7 +1833,7 @@ bool TrWindow::danger( const TQString& source, const TQString& translation, statusBar()->message( tr("A phrase book suggestion for" " '%1' was ignored.") .arg(*w), ErrorMS ); - return TRUE; + return true; } } } @@ -1841,7 +1841,7 @@ bool TrWindow::danger( const TQString& source, const TQString& translation, if ( verbose ) statusBar()->clear(); - return FALSE; + return false; } void TrWindow::readConfig() @@ -1855,7 +1855,7 @@ void TrWindow::readConfig() TQRect r( pos(), size() ); recentFiles = config.readListEntry( keybase + "RecentlyOpenedFiles" ); - if ( !config.readBoolEntry( keybase + "Geometry/MainwindowMaximized", FALSE ) ) { + if ( !config.readBoolEntry( keybase + "Geometry/MainwindowMaximized", false ) ) { r.setX( config.readNumEntry( keybase + "Geometry/MainwindowX", r.x() ) ); r.setY( config.readNumEntry( keybase + "Geometry/MainwindowY", r.y() ) ); r.setWidth( config.readNumEntry( keybase + "Geometry/MainwindowWidth", r.width() ) ); @@ -2055,15 +2055,15 @@ void TrWindow::countStats( TQListViewItem* ci, TQListViewItem* mi, int& trW, int void TrWindow::doCharCounting( const TQString& text, int& trW, int& trC, int& trCS ) { trCS += text.length(); - bool inWord = FALSE; + bool inWord = false; for ( int i = 0; i < (int) text.length(); i++ ) { if ( text[i].isLetterOrNumber() || text[i] == TQChar('_') ) { if ( !inWord ) { trW++; - inWord = TRUE; + inWord = true; } } else { - inWord = FALSE; + inWord = false; } if ( !text[i].isSpace() ) trC++; diff --git a/tools/linguist/linguist/trwindow.h b/tools/linguist/linguist/trwindow.h index 82fc4ec10..e1d5087c9 100644 --- a/tools/linguist/linguist/trwindow.h +++ b/tools/linguist/linguist/trwindow.h @@ -145,7 +145,7 @@ private: void updatePhraseDict(); PhraseBook getPhrases( const TQString& source ); bool danger( const TQString& source, const TQString& translation, - bool verbose = FALSE ); + bool verbose = false ); int itemToIndex( TQListView * view, TQListViewItem * item ); TQListViewItem * indexToItem( TQListView * view, int index ); diff --git a/tools/linguist/lrelease/main.cpp b/tools/linguist/lrelease/main.cpp index 587f62104..6671045e2 100644 --- a/tools/linguist/lrelease/main.cpp +++ b/tools/linguist/lrelease/main.cpp @@ -104,9 +104,9 @@ static void releaseTsFile( const TQString& tsFileName, bool verbose, int main( int argc, char **argv ) { - bool verbose = FALSE; - bool stripped = TRUE; - bool metTranslations = FALSE; + bool verbose = false; + bool stripped = true; + bool metTranslations = false; MetaTranslator tor; TQString outputFile; int numFiles = 0; @@ -114,10 +114,10 @@ int main( int argc, char **argv ) for ( i = 1; i < argc; i++ ) { if ( qstrcmp(argv[i], "-nocompress") == 0 ) { - stripped = FALSE; + stripped = false; continue; } else if ( qstrcmp(argv[i], "-verbose") == 0 ) { - verbose = TRUE; + verbose = true; continue; } else if ( qstrcmp(argv[i], "-version") == 0 ) { fprintf( stderr, "lrelease version %s\n", TQT_VERSION_STR ); @@ -182,7 +182,7 @@ int main( int argc, char **argv ) for ( t = toks.begin(); t != toks.end(); ++t ) { if ( it.key() == TQString("TRANSLATIONS") ) { - metTranslations = TRUE; + metTranslations = true; releaseTsFile( *t, verbose, stripped ); } } diff --git a/tools/linguist/lupdate/fetchtr.cpp b/tools/linguist/lupdate/fetchtr.cpp index c5ed953b0..80ec37094 100644 --- a/tools/linguist/lupdate/fetchtr.cpp +++ b/tools/linguist/lupdate/fetchtr.cpp @@ -275,8 +275,8 @@ static int getToken() yyCh = getChar(); } while ( yyCh != EOF && yyCh != '\n' ); } else if ( yyCh == '*' ) { - bool metAster = FALSE; - bool metAsterSlash = FALSE; + bool metAster = false; + bool metAsterSlash = false; while ( !metAsterSlash ) { yyCh = getChar(); @@ -292,11 +292,11 @@ static int getToken() yyComment[yyCommentLen++] = (char) yyCh; if ( yyCh == '*' ) - metAster = TRUE; + metAster = true; else if ( metAster && yyCh == '/' ) - metAsterSlash = TRUE; + metAsterSlash = true; else - metAster = FALSE; + metAster = false; } yyCh = getChar(); yyCommentLen -= 2; @@ -463,9 +463,9 @@ static bool matchEncoding( bool *utf8 ) } *utf8 = TQString( yyIdent ).endsWith( TQString("UTF8") ); yyTok = getToken(); - return TRUE; + return true; } else { - return FALSE; + return false; } } @@ -479,8 +479,8 @@ static void parse( MetaTranslator *tor, const char *initialContext, TQCString com; TQCString functionContext = initialContext; TQCString prefix; - bool utf8 = FALSE; - bool missing_TQ_OBJECT = FALSE; + bool utf8 = false; + bool missing_TQ_OBJECT = false; yyTok = getToken(); while ( yyTok != Tok_Eof ) { @@ -511,7 +511,7 @@ static void parse( MetaTranslator *tor, const char *initialContext, } if ( yyTok == Tok_Colon ) { - missing_TQ_OBJECT = TRUE; + missing_TQ_OBJECT = true; } else { functionContext = defaultContext; } @@ -562,7 +562,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) && @@ -581,7 +581,7 @@ static void parse( MetaTranslator *tor, const char *initialContext, } break; case Tok_TQ_OBJECT: - missing_TQ_OBJECT = FALSE; + missing_TQ_OBJECT = false; yyTok = getToken(); break; case Tok_Ident: @@ -604,7 +604,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) ); } /* @@ -647,7 +647,7 @@ static void parse( MetaTranslator *tor, const char *initialContext, } } functionContext = defaultContext; - missing_TQ_OBJECT = FALSE; + missing_TQ_OBJECT = false; } yyTok = getToken(); break; @@ -741,7 +741,7 @@ bool UiHandler::startElement( const TQString& /* namespaceURI */, flush(); } accum.truncate( 0 ); - return TRUE; + return true; } bool UiHandler::endElement( const TQString& /* namespaceURI */, @@ -764,13 +764,13 @@ bool UiHandler::endElement( const TQString& /* namespaceURI */, } else { flush(); } - return TRUE; + return true; } bool UiHandler::characters( const TQString& ch ) { accum += ch; - return TRUE; + return true; } bool UiHandler::fatalError( const TQXmlParseException& exception ) @@ -780,7 +780,7 @@ bool UiHandler::fatalError( const TQXmlParseException& exception ) exception.lineNumber(), exception.columnNumber(), exception.message().latin1() ); fprintf( stderr, "XML error: %s\n", msg.latin1() ); - return FALSE; + return false; } void UiHandler::flush() @@ -788,7 +788,7 @@ void UiHandler::flush() if ( !context.isEmpty() && !source.isEmpty() ) tor->insert( MetaTranslatorMessage(context.utf8(), source.utf8(), comment.utf8(), TQString::null, - TRUE) ); + true) ); source.truncate( 0 ); comment.truncate( 0 ); } @@ -807,10 +807,10 @@ void fetchtr_ui( const char *fileName, MetaTranslator *tor, 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 ); reader.setFeature( "http://trolltech.com/xml/features/report-whitespace" - "-only-CharData", FALSE ); + "-only-CharData", false ); TQXmlDefaultHandler *hand = new UiHandler( tor, fileName ); reader.setContentHandler( hand ); reader.setErrorHandler( hand ); diff --git a/tools/linguist/lupdate/main.cpp b/tools/linguist/lupdate/main.cpp index 1e7225081..3f4695e55 100644 --- a/tools/linguist/lupdate/main.cpp +++ b/tools/linguist/lupdate/main.cpp @@ -101,18 +101,18 @@ int main( int argc, char **argv ) TQCString codec; TQStringList tsFileNames; - bool verbose = FALSE; - bool noObsolete = FALSE; - bool metSomething = FALSE; + bool verbose = false; + bool noObsolete = false; + bool metSomething = false; int numFiles = 0; - bool standardSyntax = TRUE; - bool metTsFlag = FALSE; + bool standardSyntax = true; + bool metTsFlag = false; int i; for ( i = 1; i < argc; i++ ) { if ( qstrcmp(argv[i], "-ts") == 0 ) - standardSyntax = FALSE; + standardSyntax = false; } for ( i = 1; i < argc; i++ ) { @@ -120,16 +120,16 @@ 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 ) { fprintf( stderr, "lupdate version %s\n", TQT_VERSION_STR ); return 0; } else if ( qstrcmp(argv[i], "-ts") == 0 ) { - metTsFlag = TRUE; + metTsFlag = true; continue; } @@ -167,17 +167,17 @@ int main( int argc, char **argv ) for ( t = toks.begin(); t != toks.end(); ++t ) { if ( it.key() == "HEADERS" || it.key() == "SOURCES" ) { - fetchtr_cpp( *t, &fetchedTor, defaultContext, TRUE ); - metSomething = TRUE; + fetchtr_cpp( *t, &fetchedTor, defaultContext, true ); + metSomething = true; } else if ( it.key() == "INTERFACES" || it.key() == "FORMS" ) { - fetchtr_ui( *t, &fetchedTor, defaultContext, TRUE ); + fetchtr_ui( *t, &fetchedTor, defaultContext, true ); fetchtr_cpp( *t + ".h", &fetchedTor, defaultContext, - FALSE ); - metSomething = TRUE; + false ); + metSomething = true; } else if ( it.key() == "TRANSLATIONS" ) { tsFileNames.append( *t ); - metSomething = TRUE; + metSomething = true; } else if ( it.key() == "CODEC" || it.key() == "DEFAULTCODEC" ) { codec = (*t).latin1(); @@ -219,11 +219,11 @@ int main( int argc, char **argv ) } else { TQFileInfo fi(argv[i]); if ( TQString(argv[i]).lower().endsWith(".ui") ) { - fetchtr_ui( fi.fileName(), &fetchedTor, defaultContext, TRUE ); + fetchtr_ui( fi.fileName(), &fetchedTor, defaultContext, true ); fetchtr_cpp( TQString(fi.fileName()) + ".h", &fetchedTor, - defaultContext, FALSE ); + defaultContext, false ); } else { - fetchtr_cpp( fi.fileName(), &fetchedTor, defaultContext, TRUE ); + fetchtr_cpp( fi.fileName(), &fetchedTor, defaultContext, true ); } } } diff --git a/tools/linguist/lupdate/numberh.cpp b/tools/linguist/lupdate/numberh.cpp index 29d6fd2f9..4ff8d09eb 100644 --- a/tools/linguist/lupdate/numberh.cpp +++ b/tools/linguist/lupdate/numberh.cpp @@ -73,14 +73,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++]; } @@ -125,7 +125,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++; } @@ -168,7 +168,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; 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, diff --git a/tools/linguist/tqm2ts/main.cpp b/tools/linguist/tqm2ts/main.cpp index 6e71a3cbc..f4d93b500 100644 --- a/tools/linguist/tqm2ts/main.cpp +++ b/tools/linguist/tqm2ts/main.cpp @@ -53,7 +53,7 @@ static void printUsage() int main( int argc, char **argv ) { - bool verbose = FALSE; + bool verbose = false; int numQmFiles = 0; for ( int i = 1; i < argc; i++ ) { @@ -61,7 +61,7 @@ int main( int argc, char **argv ) printUsage(); return 0; } else if ( qstrcmp(argv[i], "-verbose") == 0 ) { - verbose = TRUE; + verbose = true; continue; } else if ( qstrcmp(argv[i], "-version") == 0 ) { fprintf( stderr, "tqm2ts version %s\n", TQT_VERSION_STR ); @@ -92,7 +92,7 @@ int main( int argc, char **argv ) context = "@default"; metator.insert( MetaTranslatorMessage(context, (*it).sourceText(), (*it).comment(), - (*it).translation(), FALSE, + (*it).translation(), false, MetaTranslatorMessage::Finished) ); } } |
