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

Class Index

kdat'FileNode (./kdeadmin/kdat/Node.h:776)

class FileNode : public ArchiveableNode {
public:
    /**
     * Create a file node.
     *
     * @param text  The name of the file.  The full path is determined by
     *              traversing the tree to the root node.
     * @param state The initial selection state of the node.
     */
    FileNode( const char* text, int state );

    /**
     * Compute the full path name of this node.  Nodes representing
     * directories end with a '/'.
     *
     * @return The full path of the file that this node represents.
     */
    virtual const char* getFullPath();

    /**
     * Determine whether the node is an instance of the given node type.
     *
     * @param type The type to compare against.
     */
    virtual bool isType( int type );

    /**
     * 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 tape drive.
 */

kdat'FileNode::FileNode() (./kdeadmin/kdat/Node.cpp:1138)

FileNode::FileNode( const char* text, int state )
        : ArchiveableNode( FileNodeType, text, *ImageCache::instance()->getFile(), state )
{
}


kdat'FileNode::getFullPath() (./kdeadmin/kdat/Node.cpp:1143)

const char* FileNode::getFullPath()
{
    if ( _fullPath.length() == 0 ) {
        _fullPath = ((ArchiveableNode*)getParent())->getFullPath() + getText();
    }

    return _fullPath;
}


kdat'FileNode::isType() (./kdeadmin/kdat/Node.cpp:1152)

bool FileNode::isType( int type )
{
    if ( type == FileNodeType ) {
        return TRUE;
    } else {
        return ArchiveableNode::isType( type );
    }
}


kdat'FileNode::selected() (./kdeadmin/kdat/Node.cpp:1161)

void FileNode::selected()
{
    // Construct the full path.
    QString path;
    Node* n;
    for ( n = this; n->getType() != RootNodeType; n = (Node*)n->getParent() ) {
        path.prepend( "/" );
        path.prepend( n->getText() );
    }
    path.prepend( "/" );
    path = path.left( path.length() - 1 );

    KDat::getInstance()->showFileInfo( path );
}


kdat'FileNode::popupMenu() (./kdeadmin/kdat/Node.cpp:1176)

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