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

void KDirTreeView::selectItem ( KFileInfo item ) [slot]

Select a KDirTree item. Used for connecting the KDirTree::selectionChanged() signal.

Definition at line 619 of file kdirtreeview.cpp.

References clearSelection(), closeAllExcept(), locate(), KDirStat::KDirTreeViewItem::orig(), selectionChanged(), and KDirStat::KDirTreeViewItem::setOpen().

{
    // Short-circuit for the most common case: The signal has been triggered by
    // this view, and the KDirTree has sent it right back.

    if ( _selection && _selection->orig() == newSelection )
      return;

    if ( ! newSelection )
      clearSelection();
    else
    {
      _selection = locate( newSelection,
                       false, // lazy
                       true );      // doClone
      if ( _selection )
      {
          closeAllExcept( _selection );
          _selection->setOpen( false );
          ensureItemVisible( _selection );
          emit selectionChanged( _selection );
          setSelected( _selection, true );
      }
      else
          kdError() << "Couldn't clone item " << newSelection << endl;
    }
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index