Class sh::tools::BookmarkManager

class sh::tools::BookmarkManager : public QObject, public sh::base::Singleton

The bookmark manager.

Use it for getting or modifying bookmarks.

Public Functions

QList<std::shared_ptr<sh::tools::Bookmark>> getBookmarks()

Returns a list of all stored bookmarks.

bool hasBookmarks()

Checks if any bookmarks exist.

QString addBookmark(QList<QString> folder, QString label, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString tags = QString())

Adds a new bookmark.

Return

The id of the new bookmark.

void removeBookmark(QString id)

Removes a bookmarks.

void changeBookmark(QString id, QString label, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Changes data of a bookmark.

void changeBookmarkTags(QString id, QString tags)

Changes the tags of a bookmark.

void moveBookmarkUp(QString id)

Moves a bookmark up within its folder.

void moveBookmarkDown(QString id)

Moves a bookmark down within its folder.

void moveBookmarkToFolder(QString id, QList<QString> folder)

Changes to folder of a bookmark.

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).

Signals

void changed()

Private Functions

BookmarkManager()
void moveBookmark(QString id, int direction)
void _changeBookmark(QString id, std::function<QString(std::shared_ptr<Bookmark>)> label, std::function<std::shared_ptr<const sh::filesystem::Eurl>(std::shared_ptr<Bookmark>)> eurl, std::function<QList<QString>(std::shared_ptr<Bookmark>)> folder, std::function<QString(std::shared_ptr<Bookmark>)> tags)
void readBookmarks()
void writeBookmarks()

Private Members

std::shared_ptr<sh::configuration::ConfigurationValue> cfgvalBookmarks
QList<std::shared_ptr<Bookmark>> _bookmarks
QMutex _bookmarksmutex