From 4d495175043c399fdca6e1bb4c74ef176fc76fb4 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Wed, 6 Aug 2025 11:29:57 +0900 Subject: Replace TRUE/FALSE with boolean values true/false - part 4 Signed-off-by: Michele Calgaro --- doc/html/fileiconview-example.html | 102 ++++++++++++++++++------------------- 1 file changed, 51 insertions(+), 51 deletions(-) (limited to 'doc/html/fileiconview-example.html') diff --git a/doc/html/fileiconview-example.html b/doc/html/fileiconview-example.html index 3333452bb..da10f1b3d 100644 --- a/doc/html/fileiconview-example.html +++ b/doc/html/fileiconview-example.html @@ -139,7 +139,7 @@ protected slots: void sortAscending(); void sortDescending(); void arrangeItemsInGrid() { - TQIconView::arrangeItemsInGrid( TRUE ); + TQIconView::arrangeItemsInGrid( true ); } void slotRightPressed( TQIconViewItem *item ); @@ -524,7 +524,7 @@ static void cleanup() TQtFileIconViewItem::TQtFileIconViewItem( TQtFileIconView *parent, TQFileInfo *fi ) : TQIconViewItem( parent, fi->fileName() ), itemFileName( fi->filePath() ), - itemFileInfo( fi ), checkSetText( FALSE ) + itemFileInfo( fi ), checkSetText( false ) { vm = TQtFileIconView::Large; @@ -539,9 +539,9 @@ static void cleanup() if ( itemFileInfo->fileName() == "." || itemFileInfo->fileName() == ".." ) - setRenameEnabled( FALSE ); + setRenameEnabled( false ); - checkSetText = TRUE; + checkSetText = true; TQObject::connect( &timer, TQ_SIGNAL( timeout() ), iconView(), TQ_SLOT( openFolder() ) ); @@ -551,7 +551,7 @@ static void cleanup() { if ( itemFileInfo->isSymLink() ) { TQFont f( p->font() ); - f.setItalic( TRUE ); + f.setItalic( true ); p->setFont( f ); } @@ -611,7 +611,7 @@ TQtFileIconViewItem::~TQtFileIconViewItem() return; TQDir dir( itemFileInfo->dir() ); if ( dir.rename( itemFileInfo->fileName(), text ) ) { - itemFileName = itemFileInfo->dirPath( TRUE ) + "/" + text; + itemFileName = itemFileInfo->dirPath( true ) + "/" + text; delete itemFileInfo; itemFileInfo = new TQFileInfo( itemFileName ); TQIconViewItem::setText( text ); @@ -625,9 +625,9 @@ TQtFileIconViewItem::~TQtFileIconViewItem() { if ( type() == Dir && e->provides( "text/uri-list" ) && dropEnabled() ) - return TRUE; + return true; - return FALSE; + return false; } void TQtFileIconViewItem::dropped( TQDropEvent *e, const TQValueList<TQIconDragItem> & ) @@ -713,7 +713,7 @@ TQtFileIconViewItem::~TQtFileIconViewItem() setGridX( 75 ); setResizeMode( Adjust ); - setWordWrapIconText( FALSE ); + setWordWrapIconText( false ); connect( this, TQ_SIGNAL( doubleClicked( TQIconViewItem * ) ), this, TQ_SLOT( itemDoubleClicked( TQIconViewItem * ) ) ); @@ -727,8 +727,8 @@ TQtFileIconViewItem::~TQtFileIconViewItem() setHScrollBarMode( AlwaysOff ); setVScrollBarMode( Auto ); - setAutoArrange( TRUE ); - setSorting( TRUE ); + setAutoArrange( true ); + setSorting( true ); openItem = 0; } @@ -759,22 +759,22 @@ void TQtFileIconView::setDirectory( const TQDir &di void TQtFileIconView::newDirectory() { - setAutoArrange( FALSE ); - selectAll( FALSE ); + setAutoArrange( false ); + selectAll( false ); if ( viewDir.mkdir( TQString( "New Folder %1" ).arg( ++newFolderNum ) ) ) { TQFileInfo *fi = new TQFileInfo( viewDir, TQString( "New Folder %1" ).arg( newFolderNum ) ); TQtFileIconViewItem *item = new TQtFileIconViewItem( this, new TQFileInfo( *fi ) ); item->setKey( TQString( "000000%1" ).arg( fi->fileName() ) ); delete fi; - repaintContents( contentsX(), contentsY(), contentsWidth(), contentsHeight(), FALSE ); + repaintContents( contentsX(), contentsY(), contentsWidth(), contentsHeight(), false ); ensureItemVisible( item ); - item->setSelected( TRUE, TRUE ); + item->setSelected( true, true ); setCurrentItem( item ); repaintItem( item ); tqApp->processEvents(); item->rename(); } - setAutoArrange( TRUE ); + setAutoArrange( true ); } TQDir TQtFileIconView::currentDir() @@ -786,22 +786,22 @@ static bool isRoot( const TQString &s ) { #if defined(Q_OS_UNIX) if ( s == "/" ) - return TRUE; + return true; #elif defined(Q_OS_WIN32) TQString p = s; if ( p.length() == 3 && p.right( 2 ) == ":/" ) - return TRUE; + return true; if ( p[ 0 ] == '/' && p[ 1 ] == '/' ) { int slashes = p.contains( '/' ); if ( slashes <= 3 ) - return TRUE; + return true; if ( slashes == 4 && p[ (int)p.length() - 1 ] == '/' ) - return TRUE; + return true; } #endif - return FALSE; + return false; } void TQtFileIconView::readDir( const TQDir &dir ) @@ -824,7 +824,7 @@ void TQtFileIconView::readDir( const TQD TQFileInfoListIterator it( *filist ); TQFileInfo *fi; - bool allowRename = FALSE, allowRenameSet = FALSE; + bool allowRename = false, allowRenameSet = false; while ( ( fi = it.current() ) != 0 ) { ++it; if ( fi && fi->fileName() == ".." && ( fi->dirPath() == "/" || fi->dirPath().isEmpty() ) ) @@ -838,13 +838,13 @@ void TQtFileIconView::readDir( const TQD if ( !allowRenameSet ) { if ( !TQFileInfo( fi->absFilePath() ).isWritable() || item->text() == "." || item->text() == ".." ) - allowRename = FALSE; + allowRename = false; else - allowRename = TRUE; + allowRename = true; if ( item->text() == "." || item->text() == ".." ) - allowRenameSet = FALSE; + allowRenameSet = false; else - allowRenameSet = TRUE; + allowRenameSet = true; } item->setRenameEnabled( allowRename ); } @@ -886,11 +886,11 @@ void TQtFileIconView::itemDoubleClicked( TQIconDragItem id; id.setData( TQCString( item->filename() ) ); drag->append( id, - TQRect( item->pixmapRect( FALSE ).x() - orig.x(), - item->pixmapRect( FALSE ).y() - orig.y(), + TQRect( item->pixmapRect( false ).x() - orig.x(), + item->pixmapRect( false ).y() - orig.y(), item->pixmapRect().width(), item->pixmapRect().height() ), - TQRect( item->textRect( FALSE ).x() - orig.x(), - item->textRect( FALSE ).y() - orig.y(), + TQRect( item->textRect( false ).x() - orig.x(), + item->textRect( false ).y() - orig.y(), item->textRect().width(), item->textRect().height() ), TQString( item->filename() ) ); } @@ -974,22 +974,22 @@ void TQtFileIconView::flowSouth() void TQtFileIconView::sortAscending() { - sort( TRUE ); + sort( true ); } void TQtFileIconView::sortDescending() { - sort( FALSE ); + sort( false ); } void TQtFileIconView::itemTextTruncate() { - setWordWrapIconText( FALSE ); + setWordWrapIconText( false ); } void TQtFileIconView::itemTextWordWrap() { - setWordWrapIconText( TRUE ); + setWordWrapIconText( true ); } void TQtFileIconView::slotRightPressed( TQIconViewItem *item ) @@ -1014,7 +1014,7 @@ void TQtFileIconView::slotRightPressed( insertItem( "Sort &ascending", this, TQ_SLOT( sortAscending() ) ); menu.insertItem( "Sort &descending", this, TQ_SLOT( sortDescending() ) ); - menu.setMouseTracking( TRUE ); + menu.setMouseTracking( true ); menu.exec( TQCursor::pos() ); } else { // on item TQPopupMenu menu( this ); @@ -1022,7 +1022,7 @@ void TQtFileIconView::slotRightPressed( insertItem( "Rename Item" ); int REMOVE_ITEM = menu.insertItem( "Remove Item" ); - menu.setMouseTracking( TRUE ); + menu.setMouseTracking( true ); int id = menu.exec( TQCursor::pos() ); if ( id == -1 ) @@ -1199,11 +1199,11 @@ void FileMainWindow::setup() { TQSplitter *splitter = new TQSplitter( this ); - dirlist = new DirectoryView( splitter, "dirlist", TRUE ); + dirlist = new DirectoryView( splitter, "dirlist", true ); dirlist->addColumn( "Name" ); dirlist->addColumn( "Type" ); Directory *root = new Directory( dirlist, "/" ); - root->setOpen( TRUE ); + root->setOpen( true ); splitter->setResizeMode( dirlist, TQSplitter::KeepSize ); fileview = new TQtFileIconView( "/", splitter ); @@ -1212,12 +1212,12 @@ void FileMainWindow::setup() setCentralWidget( splitter ); TQToolBar *toolbar = new TQToolBar( this, "toolbar" ); - setRightJustification( TRUE ); + setRightJustification( true ); (void)new TQLabel( tr( " Path: " ), toolbar ); - pathCombo = new TQComboBox( TRUE, toolbar ); - pathCombo->setAutoCompletion( TRUE ); + pathCombo = new TQComboBox( true, toolbar ); + pathCombo->setAutoCompletion( true ); toolbar->setStretchableWidget( pathCombo ); connect( pathCombo, TQ_SIGNAL( activated( const TQString & ) ), this, TQ_SLOT ( changePath( const TQString & ) ) ); @@ -1245,13 +1245,13 @@ void FileMainWindow::setup() connect( fileview, TQ_SIGNAL( readDirDone() ), this, TQ_SLOT( slotReadDirDone() ) ); - setDockEnabled( DockLeft, FALSE ); - setDockEnabled( DockRight, FALSE ); + setDockEnabled( DockLeft, false ); + setDockEnabled( DockRight, false ); label = new TQLabel( statusBar() ); - statusBar()->addWidget( label, 2, TRUE ); + statusBar()->addWidget( label, 2, true ); progress = new TQProgressBar( statusBar() ); - statusBar()->addWidget( progress, 1, TRUE ); + statusBar()->addWidget( progress, 1, true ); connect( fileview, TQ_SIGNAL( enableUp() ), this, TQ_SLOT( enableUp() ) ); @@ -1267,10 +1267,10 @@ void FileMainWindow::setPathCombo() { TQString dir = caption(); int i = 0; - bool found = FALSE; + bool found = false; for ( i = 0; i < pathCombo->count(); ++i ) { if ( pathCombo->text( i ) == dir) { - found = TRUE; + found = true; break; } } @@ -1331,22 +1331,22 @@ void FileMainWindow::changePath( const FileMainWindow::enableUp() { - upButton->setEnabled( TRUE ); + upButton->setEnabled( true ); } void FileMainWindow::disableUp() { - upButton->setEnabled( FALSE ); + upButton->setEnabled( false ); } void FileMainWindow::enableMkdir() { - mkdirButton->setEnabled( TRUE ); + mkdirButton->setEnabled( true ); } void FileMainWindow::disableMkdir() { - mkdirButton->setEnabled( FALSE ); + mkdirButton->setEnabled( false ); } -- cgit v1.2.3