diff options
Diffstat (limited to 'examples/fileiconview/tqfileiconview.cpp')
-rw-r--r-- | examples/fileiconview/tqfileiconview.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
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 ) |