Class sh::tools::VisibleViews

class sh::tools::VisibleViews : public sh::base::Singleton

Used for keeping track of which fileviews show which directories.

Whenever the view goes to other directories, this manager gets notified and redirects the notification to some other parts of the program.

Public Functions

std::shared_ptr<QObject> viewEnteredDirectory(std::shared_ptr<sh::filesystem::FilesystemNode> dir)

Called when a view enters the given directory node. .

void registerOnEnteredHandlers(std::function<void(std::shared_ptr<sh::filesystem::FilesystemNode> dir)> handler)

Registers a function to be called whenever the view just entered the given directory node.

void registerOnLeftHandlers(std::function<void(std::shared_ptr<sh::filesystem::FilesystemNode> dir)> handler)

Registers a function to be called whenever the view just left the given directory node.

void doInitialize()

Executes singleton initialization.

void doShutdown()

Executes singleton shutdown.

void shutdown()

Shutdown down this singleton.

bool isAlive()

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

Private Functions

VisibleViews()

Private Members

QHash<std::shared_ptr<sh::filesystem::FilesystemNode>, int> visibleDirs
QList<std::function<void(std::shared_ptr<sh::filesystem::FilesystemNode>)>> onenteredhandlers
QList<std::function<void(std::shared_ptr<sh::filesystem::FilesystemNode>)>> onlefthandlers