Class sh::filesystem::LoadOnDemandPlaceholderFilesystemNode

class sh::filesystem::LoadOnDemandPlaceholderFilesystemNode : public sh::filesystem::FilesystemNode

A special node, which is unselectable and shows a ‘loading’ label.

It does not correspond to a file, directory or similar which actually exists. It is also never parent or a child of another node.

They are used internally by the filesystem model.

Public Functions

QString displayName()

Returns the display name (what the user interface displays).

void requestDetails(bool force)

Requests to fetch details for this node.

LoadOnDemandPlaceholderFilesystemNode(std::shared_ptr<sh::filesystem::FilesystemNode> parent)

Constructed only by the infrastructure and made available otherwise.

std::shared_ptr<const sh::filesystem::Eurl> eurl()

Returns the sh::filesystem::Eurl entry address.

sh::filesystem::FilesystemModel *model()

Convenience shortcut to the sh::filesystem::FilesystemModel.

void setDisplayName(QString displayname)

Sets the display name (what the user interface displays).

sh::filesystem::FilesystemHandler *handler()

Returns the handler which is responsible for this node. This should be the same as sh::filesystem::FilesystemHandlerRegister.findHandler(eurl.scheme).

int nodetype()

Returns the FilesystemNodeType node type.

int childnodeCount()

Returns the number of children nodes.

std::shared_ptr<sh::filesystem::FilesystemNode> childnode(int i)

Returns i-th child node.

sh::filesystem::ModelBackedFilesystemNodeList *childnodes()

Returns the list of children.

std::shared_ptr<sh::filesystem::FilesystemNode> parentnode() const

Returns the parent node.

This is 0 if the node does not exist in the model (i.e. not yet inserted or removed afterwards). In most cases, this can be interpreted as ‘file currently does not exist’.

int index()

Returns the index of this node in the parent’s list of children.

void addChild(std::shared_ptr<sh::filesystem::FilesystemNode> node)

Adds a new child. Not allowed to call more than once for a node.

void removeChild(std::shared_ptr<sh::filesystem::FilesystemNode> node)

Removes a new child. Not allowed to call more than once for a node.

bool isFetchingSubitems()

Checks if currently subitems are fetched (i.e. the ‘loading’ node is shown).

QIcon icon()

Returns the node icon.

void setIcon(QIcon icon)

Sets the node icon.

bool isHidden()

Returns if the node is hidden.

Note: It’s not difficult for the user to also show the hidden items.

void setHidden(bool v)

Sets if the node is hidden.

See also isHidden().

void addDetail(std::shared_ptr<sh::filesystem::DetailColumn> column)

Adds a detail to this node.

std::shared_ptr<sh::filesystem::DetailColumn> getDetailColumnByIndex(int index)

Returns the i-th detail column registered to this node.

int getDetailColumnsCount() const

Returns the number of detail columns registered to this node.

bool isRootNode() const

Checks if this is the root node of the model.

bool isConfigured() const

Checks if this node was already configured by a handler.

bool isAlive() const

Checks if this node currently exists in the model.

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> linkDestinationNodes() const

Returns the list of link source nodes. If this node is a link, the link destination nodes may influence the behavior and appearance of this node.

This information does not come from inside but must be set from outside the model implementation.

void setLinkDestinationNodes(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> linkdestinations)

Sets the list of link destination nodes. If this node is a link, the link destination nodes may influence the behavior and appearance of this node.

void requestContainedItems(sh::filesystem::FilesystemNodeType type = FilesystemNodeType::NONE)

Requests to fetch the children of this node with help of the filesystem handler.

Signals

void removed()

Is emitted when this node is not placed in the tree anymore. This does not mean the physical deletion of the instance, but just means it is not alive from now on.

void _detailsAvailable()

Is emitted when values for detail columns arrived.

void iconChanged()

Is emitted when the icon changed.

void isHiddenChanged()

Is emitted when the hidden flag changed.

Private Members

bool loading

Friends

friend class sh::filesystem::FilesystemModel