Source Code (Use browser search to find items of interest.)

Class Index

kdat'ArchiveNode (./kdeadmin/kdat/Node.h:187)

class ArchiveNode : public Node {
    Archive* _archive;
public:
    /**
     * Create an archive node.
     *
     * @param archive A pointer to the archive that this node represents.
     */
    ArchiveNode( 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();

    /**
     * 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 an archive.
 */

kdat'ArchiveNode::ArchiveNode() (./kdeadmin/kdat/Node.cpp:244)

ArchiveNode::ArchiveNode( Archive* archive )
        : Node( ArchiveNodeType, archive->getName(), *ImageCache::instance()->getArchive() ),
          _archive( archive )
{
    setDelayedExpanding( TRUE );
}


kdat'ArchiveNode::getArchive() (./kdeadmin/kdat/Node.cpp:251)

Archive* ArchiveNode::getArchive()
{
    return _archive;
}


kdat'ArchiveNode::validate() (./kdeadmin/kdat/Node.cpp:256)

bool ArchiveNode::validate()
{
    bool changed = _archive->getName() != getText();
    if ( changed ) {
        setText( _archive->getName() );
    }

    return changed;
}


kdat'ArchiveNode::isType() (./kdeadmin/kdat/Node.cpp:266)

bool ArchiveNode::isType( int type )
{
    if ( type == ArchiveNodeType ) {
        return TRUE;
    } else {
        return Node::isType( type );
    }
}


kdat'ArchiveNode::expanding() (./kdeadmin/kdat/Node.cpp:275)

void ArchiveNode::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 TapeDirectoryNode( f.current() ) );
        } else {
            insertNode( new TapeFileNode( f.current() ) );
        }
    }
}


kdat'ArchiveNode::selected() (./kdeadmin/kdat/Node.cpp:294)

void ArchiveNode::selected()
{
    KDat::getInstance()->showArchiveInfo( _archive );
}


kdat'ArchiveNode::popupMenu() (./kdeadmin/kdat/Node.cpp:299)

void ArchiveNode::popupMenu( const QPoint& p )
{
    KDat::getInstance()->popupArchiveMenu( p );
}