mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-22 03:26:05 -04:00
Improve const correctness in Library
This makes getBookIds(), listBookIds(), and getBookmarks() const member functions
This commit is contained in:
parent
e1472b2a47
commit
324ffbb326
@ -76,7 +76,7 @@ std::shared_ptr<kiwix::Searcher> Library::getSearcher(const QString &zimId)
|
||||
return searcher;
|
||||
}
|
||||
|
||||
QStringList Library::getBookIds()
|
||||
QStringList Library::getBookIds() const
|
||||
{
|
||||
QStringList list;
|
||||
for(auto& id: m_library.getBooksIds()) {
|
||||
@ -85,7 +85,7 @@ QStringList Library::getBookIds()
|
||||
return list;
|
||||
}
|
||||
|
||||
QStringList Library::listBookIds(const kiwix::Filter& filter, kiwix::supportedListSortBy sortBy, bool ascending)
|
||||
QStringList Library::listBookIds(const kiwix::Filter& filter, kiwix::supportedListSortBy sortBy, bool ascending) const
|
||||
{
|
||||
QStringList list;
|
||||
auto bookIds = m_library.filter(filter);
|
||||
|
@ -30,9 +30,9 @@ public:
|
||||
QString openBookFromPath(const QString& zimPath);
|
||||
std::shared_ptr<kiwix::Reader> getReader(const QString& zimId);
|
||||
std::shared_ptr<kiwix::Searcher> getSearcher(const QString& zimId);
|
||||
QStringList getBookIds();
|
||||
QStringList listBookIds(const kiwix::Filter& filter, kiwix::supportedListSortBy sortBy, bool ascending);
|
||||
const std::vector<kiwix::Bookmark> getBookmarks(bool onlyValidBookmarks = false) { return m_library.getBookmarks(onlyValidBookmarks); }
|
||||
QStringList getBookIds() const;
|
||||
QStringList listBookIds(const kiwix::Filter& filter, kiwix::supportedListSortBy sortBy, bool ascending) const;
|
||||
const std::vector<kiwix::Bookmark> getBookmarks(bool onlyValidBookmarks = false) const { return m_library.getBookmarks(onlyValidBookmarks); }
|
||||
void addBookToLibrary(kiwix::Book& book);
|
||||
void removeBookFromLibraryById(const QString& id);
|
||||
void addBookmark(kiwix::Bookmark& bookmark);
|
||||
|
Loading…
x
Reference in New Issue
Block a user