mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-23 20:20:58 -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;
|
return searcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList Library::getBookIds()
|
QStringList Library::getBookIds() const
|
||||||
{
|
{
|
||||||
QStringList list;
|
QStringList list;
|
||||||
for(auto& id: m_library.getBooksIds()) {
|
for(auto& id: m_library.getBooksIds()) {
|
||||||
@ -85,7 +85,7 @@ QStringList Library::getBookIds()
|
|||||||
return list;
|
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;
|
QStringList list;
|
||||||
auto bookIds = m_library.filter(filter);
|
auto bookIds = m_library.filter(filter);
|
||||||
|
@ -30,9 +30,9 @@ public:
|
|||||||
QString openBookFromPath(const QString& zimPath);
|
QString openBookFromPath(const QString& zimPath);
|
||||||
std::shared_ptr<kiwix::Reader> getReader(const QString& zimId);
|
std::shared_ptr<kiwix::Reader> getReader(const QString& zimId);
|
||||||
std::shared_ptr<kiwix::Searcher> getSearcher(const QString& zimId);
|
std::shared_ptr<kiwix::Searcher> getSearcher(const QString& zimId);
|
||||||
QStringList getBookIds();
|
QStringList getBookIds() const;
|
||||||
QStringList listBookIds(const kiwix::Filter& filter, kiwix::supportedListSortBy sortBy, bool ascending);
|
QStringList listBookIds(const kiwix::Filter& filter, kiwix::supportedListSortBy sortBy, bool ascending) const;
|
||||||
const std::vector<kiwix::Bookmark> getBookmarks(bool onlyValidBookmarks = false) { return m_library.getBookmarks(onlyValidBookmarks); }
|
const std::vector<kiwix::Bookmark> getBookmarks(bool onlyValidBookmarks = false) const { return m_library.getBookmarks(onlyValidBookmarks); }
|
||||||
void addBookToLibrary(kiwix::Book& book);
|
void addBookToLibrary(kiwix::Book& book);
|
||||||
void removeBookFromLibraryById(const QString& id);
|
void removeBookFromLibraryById(const QString& id);
|
||||||
void addBookmark(kiwix::Bookmark& bookmark);
|
void addBookmark(kiwix::Bookmark& bookmark);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user