Class sh::filesystemhandlers::GnomeIONetworkFilesystemHandler

class sh::filesystemhandlers::GnomeIONetworkFilesystemHandler : public sh::filesystemhandlers::GnomeIOFilesystemHandler, public sh::base::Singleton

A filesystem handler for the GIO filesystem ‘Network’ subtree.

Public Functions

QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls) override
void requestNewNode(std::shared_ptr<const sh::filesystem::Eurl> eurl, std::shared_ptr<sh::filesystem::FilesystemNode> *nnode)

Requests a new network node.

void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list)
void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list) = 0

Determine a list of subelements in a certain directory.

sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine if a file is regular, or a dir, or a link, …

qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the size of a file.

QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the mtime of a file.

void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time)
void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time) = 0

Set the mtime of a file.

QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine mime type of a file.

QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Resolve a link.

bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to get the content of a certain file.

std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Get the content of a file.

bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create subdirectories in a certain directory.

void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Create a directory.

bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create a link in a certain directory.

void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target)
void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target) = 0

Create a link.

bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create files in a certain directory.

void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer)
void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer) = 0

Creates a file with some content.

It may use handlertransfer for some better integration, like cancel support and progress monitoring.

bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to delete a certain file/directory/link/….

void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Delete a file/directory/link/…

bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src)
bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src) = 0

Returns if it is allowed to rename a certain file, directory, link, … (see renameItem).

void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath)
void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath) = 0

Renames an item to another path.

It can be a simple filename change or also changes in the deeper path segments.

QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls) = 0

Returns a list of actions (see former example) for showing for certain files.

bool requiresResolvedLinks()

Returns if this handler requires to be used by the engine with resolved links.

bool isWellKnownScheme()

Returns if the scheme for this handler is a well known one (which external programs typically would understand).

void configureItems(sh::filesystem::Operation *op, QList<std::shared_ptr<FilesystemNode>> nodes)

Configure newly created nodes (e.g. setting another icon or changing the display name).

QList<QString> listExtendedAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Fetches the list of available extended attributes for an entry.

quint64 getExtendedAttributeSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the site of value for one extended attribute for an entry.

QByteArray getExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the value for one extended attribute for an entry.

void setExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QByteArray value)

Sets the value for one extended attribute for an entry.

void removeExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Removes one extended attributes for an entry.

QMap<QString, QString> getCustomAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Returns the custom attributes for an entry.

In contrast to extended attributes, the custom attributes are not directly stored in the filesystem this way, but handle implementation specific aspects (like permissions).

void setCustomAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QString value)

Sets the value for one custom attribute for an entry.

See also getCustomAttributes.

void deleteDirectoryIfEmpty(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Deletes a directory only of it is empty.

void viewEnteredDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view entered some directory (e.g. for enabling watchers). See also viewLeftDirectory.

void viewLeftDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view left some directory. See also viewEnteredDirectory.

void search(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>, QList<std::shared_ptr<sh::search::SearchCriterion>>, sh::filesystem::FilesystemNodeType ftype)> addfile, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>)> visitdir, QList<std::shared_ptr<sh::search::SearchCriterion>> criteria, )

Helps searching for files.

Override this method with a behavior identical to the default, if a specialized implementation can be much faster than the default one.

void customizeUi(std::shared_ptr<sh::filesystem::FilesystemNode> node, bool *showSearchPanel)

Creates a custom gui, which becomes part of the fileview.

sh::filesystem::FilesystemModel *model()

A convenience shortcut to the sh::filesystem::FilesystemModel (a singleton).

void doShutdown()

Executes singleton shutdown.

void shutdown()

Shutdown down this singleton.

bool isAlive()

Returns if this singleton is alive (true until its shutdown begins).

Public Static Functions

QString mountDevice(QString gvolumeuuid, sh::actions::ActionExecutionInfo *info)
QString mountLocation(QString gurl, sh::actions::ActionExecutionInfo *info)
QString unmountLocation(QString gurl, sh::actions::ActionExecutionInfo *info)
QByteArray eurl2gurlb(std::shared_ptr<const sh::filesystem::Eurl> eurl)
QString eurl2gurl(std::shared_ptr<const sh::filesystem::Eurl> eurl)
std::shared_ptr<const sh::filesystem::Eurl> gurl2eurl(QString gurl)
void logIfError(void *error)
void throwIfError(void *error)

Private Functions

GnomeIONetworkFilesystemHandler()