Source Code (Use browser search to find items of interest.)
Class Index
kdat'MountedArchiveNode (./kdeadmin/kdat/Node.h:415)
class MountedArchiveNode : public RangeableNode {
Archive* _archive;
public:
/**
* Create an mounted archive node.
*
* @param archive A pointer to the archive that this node represents.
*/
MountedArchiveNode( Archive* archive );
/**
* Get the archive associated with this node.
*
* @return A pointer to the archive.
*/
Archive* getArchive();
/**
* Make sure that the displayed information matches the tape index. This
* method recurses through child nodes.
*
* @return TRUE if the node's text has changed.
*/
bool validate();
/**
* Get a list of all the selected ranges for the subtree rooted at this
* node.
*/
virtual const QList<Range>& getRanges();
/**
* Select/deselect this node and all of its children.
*
* @param selected TRUE means the node will be selected, FALSE means the
* node will be deselected.
*/
virtual void setSelected( bool selected );
/**
* Determine whether the node is an instance of the given node type.
*
* @param type The type to compare against.
*/
virtual bool isType( int type );
/**
* Create child nodes for each top-level file/directory contained in the
* archive.
*
* @param expand This will always be set to TRUE.
*/
virtual void expanding( bool expand=TRUE );
/**
* This method is called immediately after the node has been selected.
*/
virtual void selected();
/**
* This method is called when the user right-clicks the mouse over the
* node.
*/
virtual void popupMenu( const QPoint& p );
};
/**
* @short This node represents a single directory within a mounted archive.
*/
kdat'MountedArchiveNode::MountedArchiveNode() (./kdeadmin/kdat/Node.cpp:624)
MountedArchiveNode::MountedArchiveNode( Archive* archive )
: RangeableNode( MountedArchiveNodeType, archive->getName(), *ImageCache::instance()->getArchive(), SelNone ),
_archive( archive )
{
setDelayedExpanding( TRUE );
}
kdat'MountedArchiveNode::getArchive() (./kdeadmin/kdat/Node.cpp:631)
Archive* MountedArchiveNode::getArchive()
{
return _archive;
}
kdat'MountedArchiveNode::getRanges() (./kdeadmin/kdat/Node.cpp:636)
const QList<Range>& MountedArchiveNode::getRanges()
{
return _archive->getRanges();
}
kdat'MountedArchiveNode::validate() (./kdeadmin/kdat/Node.cpp:641)
bool MountedArchiveNode::validate()
{
bool changed = _archive->getName() != getText();
if ( changed ) {
setText( _archive->getName() );
}
return changed;
}
kdat'MountedArchiveNode::setSelected() (./kdeadmin/kdat/Node.cpp:651)
void MountedArchiveNode::setSelected( bool select )
{
if ( select ) {
// Deselect all other archives.
Node* parent = (Node*)getParent();
for ( int i = parent->childCount() - 1; i >= 0; i-- ) {
if ( parent->childAt( i ) != this ) {
((SelectableNode*)parent->childAt( i ))->setSelected( FALSE );
}
}
}
SelectableNode::setSelected( select );
}
kdat'MountedArchiveNode::isType() (./kdeadmin/kdat/Node.cpp:666)
bool MountedArchiveNode::isType( int type )
{
if ( type == MountedArchiveNodeType ) {
return TRUE;
} else {
return RangeableNode::isType( type );
}
}
kdat'MountedArchiveNode::expanding() (./kdeadmin/kdat/Node.cpp:675)
void MountedArchiveNode::expanding( bool expand )
{
expand = TRUE;
if ( childCount() > 0 ) {
// We already have the children added.
return;
}
QListIterator<File> f( _archive->getChildren() );
for ( ; f.current(); ++f ) {
if ( f.current()->getName()[f.current()->getName().length()-1] == '/' ) {
insertNode( new MountedTapeDirectoryNode( f.current(), _state == SelSome ? SelNone : _state ) );
} else {
insertNode( new MountedTapeFileNode( f.current(), _state == SelSome ? SelNone : _state ) );
}
}
}
kdat'MountedArchiveNode::selected() (./kdeadmin/kdat/Node.cpp:694)
void MountedArchiveNode::selected()
{
KDat::getInstance()->showArchiveInfo( _archive );
}
kdat'MountedArchiveNode::popupMenu() (./kdeadmin/kdat/Node.cpp:699)
void MountedArchiveNode::popupMenu( const QPoint& p )
{
KDat::getInstance()->popupMountedArchiveMenu( p );
}