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

void KDirTreeViewItem::deferredClone (  )

Bring (the top level of) this branch of the view tree in sync with the original tree. Does _not_ recurse into subdirectories - only this level of this branch is processed. Called when lazy tree cloning is in effect and this branch is about to be opened.

Definition at line 1388 of file kdirtreeview.cpp.

References KDirStat::KFileInfo::dotEntry(), KDirStat::KFileInfo::firstChild(), firstChild(), KDirStat::KFileInfo::hasChildren(), KDirTreeViewItem(), locate(), KDirStat::KFileInfo::next(), and KDirStat::KFileInfo::treeLevel().

Referenced by locate(), and setOpen().

{
    // _view->incDebugCount(3);

    if ( ! _orig->hasChildren() )
    {
      // kdDebug() << k_funcinfo << "Oops, no children - sorry for bothering you!" << endl;
      setExpandable( false );

      return;
    }


    // Clone all normal children

    int level            = _orig->treeLevel();
    bool startingClean   = ! firstChild();
    KFileInfo *origChild = _orig->firstChild();

    while ( origChild )
    {
      if ( startingClean ||
           ! locate( origChild,
                   false,           // lazy
                   true,            // doClone
                   level ) )
      {
          // kdDebug() << "Deferred cloning " << origChild << endl;
          new KDirTreeViewItem( _view, this, origChild );
      }

      origChild = origChild->next();
    }


    // Clone the dot entry

    if ( _orig->dotEntry() &&
       ( startingClean ||
         ! locate( _orig->dotEntry(),
                 false, // lazy
                 true,  // doClone
                 level )
         )
       )
    {
      // kdDebug() << "Deferred cloning dot entry for " << _orig << endl;
      new KDirTreeViewItem( _view, this, _orig->dotEntry() );
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index