Logo Search packages:      
Sourcecode: k4dirstat version File versions  Download package

KDirTreeView::KDirTreeView ( QWidget *  parent = 0 )

Default constructor.

Definition at line 47 of file kdirtreeview.cpp.

References columnResized(), createTree(), ensureContrast(), paletteChanged(), popupContextMenu(), readConfig(), selectionChanged(), selectItem(), setDebugFunc(), setDefaultFillColors(), and setSorting().

    : KDirTreeViewParentClass( parent )
{
    _tree         = 0;
    _updateTimer  = 0;
    _selection          = 0;
    _openLevel          = 1;
    _doLazyClone  = true;
    _doPacManAnimation  = false;
    _updateInterval     = 333;      // millisec
    _sortCol            = -1;

    for ( int i=0; i < DEBUG_COUNTERS; i++ )
      _debugCount[i]    = 0;

    setDebugFunc( 1, "KDirTreeViewItem::init()" );
    setDebugFunc( 2, "KDirTreeViewItem::updateSummary()" );
    setDebugFunc( 3, "KDirTreeViewItem::deferredClone()" );
    setDebugFunc( 4, "KDirTreeViewItem::compare()" );
    setDebugFunc( 5, "KDirTreeViewItem::paintCell()" );

#if SEPARATE_READ_JOBS_COL
    _readJobsCol  = -1;
#endif
    setRootIsDecorated( false );

    int numCol = 0;
    addColumn( i18n( "Name"               ) ); _nameCol           = numCol;
    _iconCol = numCol++;
    addColumn( i18n( "Subtree Percentage"       ) ); _percentBarCol     = numCol++;
    addColumn( i18n( "Percentage"         ) ); _percentNumCol     = numCol++;
    addColumn( i18n( "Subtree Total"            ) ); _totalSizeCol      = numCol++;
    _workingStatusCol = _totalSizeCol;
    addColumn( i18n( "Own Size"                 ) ); _ownSizeCol  = numCol++;
    addColumn( i18n( "Items"              ) ); _totalItemsCol     = numCol++;
    addColumn( i18n( "Files"              ) ); _totalFilesCol     = numCol++;
    addColumn( i18n( "Subdirs"                  ) ); _totalSubDirsCol   = numCol++;
    addColumn( i18n( "Last Change"        ) ); _latestMtimeCol    = numCol++;

#if ! SEPARATE_READ_JOBS_COL
    _readJobsCol = _percentBarCol;
#endif

    setColumnAlignment ( _totalSizeCol,         Qt::AlignRight );
    setColumnAlignment ( _percentNumCol,  Qt::AlignRight );
    setColumnAlignment ( _ownSizeCol,           Qt::AlignRight );
    setColumnAlignment ( _totalItemsCol,  Qt::AlignRight );
    setColumnAlignment ( _totalFilesCol,  Qt::AlignRight );
    setColumnAlignment ( _totalSubDirsCol,      Qt::AlignRight );
    setColumnAlignment ( _readJobsCol,          Qt::AlignRight );


    setSorting( _totalSizeCol );


#define loadIcon(ICON)  KIconLoader::global()->loadIcon( (ICON), KIconLoader::Small )

    _openDirIcon  = loadIcon( "folder-open"     );
    _closedDirIcon      = loadIcon( "folder"          );
    _openDotEntryIcon   = loadIcon( "folder-orange"     );
    _closedDotEntryIcon = loadIcon( "folder-orange"   );
    _unreadableDirIcon  = loadIcon( "folder-locked"   );
    _mountPointIcon     = loadIcon( "drive-harddisk"  );
    _fileIcon           = loadIcon( "mime_empty"      );
    _symLinkIcon  = loadIcon( "emblem-symbolic-link");      // The KDE standard link icon is ugly!
    _blockDevIcon = loadIcon( "blockdevice"     );
    _charDevIcon  = loadIcon( "chardevice"      );
    _fifoIcon           = loadIcon( "socket"          );
    _stopIcon           = loadIcon( "process-stop"    );
    _readyIcon          = QPixmap();

#undef loadIcon

    setDefaultFillColors();
    readConfig();
    ensureContrast();


    connect( kapp,      SIGNAL( kdisplayPaletteChanged()    ),
           this,  SLOT  ( paletteChanged()            ) );

    connect( this,      SIGNAL( selectionChanged      ( Q3ListViewItem * ) ),
           this,  SLOT  ( selectItem            ( Q3ListViewItem * ) ) );

    connect( this,      SIGNAL( rightButtonPressed    ( Q3ListViewItem *, const QPoint &, int ) ),
           this,  SLOT  ( popupContextMenu      ( Q3ListViewItem *, const QPoint &, int ) ) );

    connect( header(),  SIGNAL( sizeChange   ( int, int, int ) ),
           this,  SLOT  ( columnResized( int, int, int ) ) );

   _contextInfo     = new Q3PopupMenu;
   _idContextInfo = _contextInfo->insertItem ( "dummy" );

   createTree();
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index