diff options
Diffstat (limited to 'examples/fileiconview')
| -rw-r--r-- | examples/fileiconview/mainwindow.cpp | 30 | ||||
| -rw-r--r-- | examples/fileiconview/tqfileiconview.cpp | 70 | ||||
| -rw-r--r-- | examples/fileiconview/tqfileiconview.h | 2 |
3 files changed, 51 insertions, 51 deletions
diff --git a/examples/fileiconview/mainwindow.cpp b/examples/fileiconview/mainwindow.cpp index a559c9fbd..9b41441de 100644 --- a/examples/fileiconview/mainwindow.cpp +++ b/examples/fileiconview/mainwindow.cpp @@ -77,11 +77,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 ); @@ -90,12 +90,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 & ) ) ); @@ -123,13 +123,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() ) ); @@ -145,10 +145,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; } } @@ -209,20 +209,20 @@ void FileMainWindow::changePath( const TQString &path ) void 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 ); } diff --git a/examples/fileiconview/tqfileiconview.cpp b/examples/fileiconview/tqfileiconview.cpp index 3b56bead6..20ac7b5e5 100644 --- a/examples/fileiconview/tqfileiconview.cpp +++ b/examples/fileiconview/tqfileiconview.cpp @@ -307,7 +307,7 @@ void TQtFileIconDrag::append( const TQIconDragItem &item, const TQRect &pr, TQtFileIconViewItem::TQtFileIconViewItem( TQtFileIconView *parent, TQFileInfo *fi ) : TQIconViewItem( parent, fi->fileName() ), itemFileName( fi->filePath() ), - itemFileInfo( fi ), checkSetText( FALSE ) + itemFileInfo( fi ), checkSetText( false ) { vm = TQtFileIconView::Large; @@ -322,9 +322,9 @@ TQtFileIconViewItem::TQtFileIconViewItem( TQtFileIconView *parent, TQFileInfo *f if ( itemFileInfo->fileName() == "." || itemFileInfo->fileName() == ".." ) - setRenameEnabled( FALSE ); + setRenameEnabled( false ); - checkSetText = TRUE; + checkSetText = true; TQObject::connect( &timer, TQ_SIGNAL( timeout() ), iconView(), TQ_SLOT( openFolder() ) ); @@ -334,7 +334,7 @@ void TQtFileIconViewItem::paintItem( TQPainter *p, const TQColorGroup &cg ) { if ( itemFileInfo->isSymLink() ) { TQFont f( p->font() ); - f.setItalic( TRUE ); + f.setItalic( true ); p->setFont( f ); } @@ -394,7 +394,7 @@ void TQtFileIconViewItem::setText( const TQString &text ) 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 ); @@ -408,9 +408,9 @@ bool TQtFileIconViewItem::acceptDrop( const TQMimeSource *e ) const { 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> & ) @@ -496,7 +496,7 @@ TQtFileIconView::TQtFileIconView( const TQString &dir, TQWidget *parent, const c setGridX( 75 ); setResizeMode( Adjust ); - setWordWrapIconText( FALSE ); + setWordWrapIconText( false ); connect( this, TQ_SIGNAL( doubleClicked( TQIconViewItem * ) ), this, TQ_SLOT( itemDoubleClicked( TQIconViewItem * ) ) ); @@ -510,8 +510,8 @@ TQtFileIconView::TQtFileIconView( const TQString &dir, TQWidget *parent, const c setHScrollBarMode( AlwaysOff ); setVScrollBarMode( Auto ); - setAutoArrange( TRUE ); - setSorting( TRUE ); + setAutoArrange( true ); + setSorting( true ); openItem = 0; } @@ -542,22 +542,22 @@ void TQtFileIconView::setDirectory( const TQDir &dir ) 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() @@ -569,22 +569,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 ) @@ -607,7 +607,7 @@ void TQtFileIconView::readDir( const TQDir &dir ) 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() ) ) @@ -621,13 +621,13 @@ void TQtFileIconView::readDir( const TQDir &dir ) 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 ); } @@ -669,11 +669,11 @@ TQDragObject *TQtFileIconView::dragObject() 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() ) ); } @@ -757,22 +757,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 ) @@ -797,7 +797,7 @@ void TQtFileIconView::slotRightPressed( TQIconViewItem *item ) menu.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 ); @@ -805,7 +805,7 @@ void TQtFileIconView::slotRightPressed( TQIconViewItem *item ) int RENAME_ITEM = menu.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 ) diff --git a/examples/fileiconview/tqfileiconview.h b/examples/fileiconview/tqfileiconview.h index 6127ac0ec..b5948011d 100644 --- a/examples/fileiconview/tqfileiconview.h +++ b/examples/fileiconview/tqfileiconview.h @@ -97,7 +97,7 @@ protected slots: void sortAscending(); void sortDescending(); void arrangeItemsInGrid() { - TQIconView::arrangeItemsInGrid( TRUE ); + TQIconView::arrangeItemsInGrid( true ); } void slotRightPressed( TQIconViewItem *item ); |
