mirror of https://github.com/kiwix/libkiwix.git
Renamed 2 functions in Filter and Library
This commit is contained in:
parent
2d76f8395e
commit
80cd1fc989
|
@ -114,7 +114,7 @@ class Filter {
|
||||||
private:
|
private:
|
||||||
friend class Library;
|
friend class Library;
|
||||||
|
|
||||||
bool acceptByNonQueryCriteria(const Book& book) const;
|
bool accept(const Book& book) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -309,7 +309,7 @@ class Library
|
||||||
friend class libXMLDumper;
|
friend class libXMLDumper;
|
||||||
|
|
||||||
private: // functions
|
private: // functions
|
||||||
BookIdCollection getBooksByTitleOrDescription(const Filter& filter);
|
BookIdCollection filterViaBookDB(const Filter& filter);
|
||||||
void updateBookDB(const Book& book);
|
void updateBookDB(const Book& book);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -295,7 +295,7 @@ void Library::updateBookDB(const Book& book)
|
||||||
m_bookDB->replace_document(idterm, doc);
|
m_bookDB->replace_document(idterm, doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
Library::BookIdCollection Library::getBooksByTitleOrDescription(const Filter& filter)
|
Library::BookIdCollection Library::filterViaBookDB(const Filter& filter)
|
||||||
{
|
{
|
||||||
if ( !filter.hasQuery() )
|
if ( !filter.hasQuery() )
|
||||||
return getBooksIds();
|
return getBooksIds();
|
||||||
|
@ -331,8 +331,8 @@ Library::BookIdCollection Library::getBooksByTitleOrDescription(const Filter& fi
|
||||||
Library::BookIdCollection Library::filter(const Filter& filter)
|
Library::BookIdCollection Library::filter(const Filter& filter)
|
||||||
{
|
{
|
||||||
BookIdCollection result;
|
BookIdCollection result;
|
||||||
for(auto id : getBooksByTitleOrDescription(filter)) {
|
for(auto id : filterViaBookDB(filter)) {
|
||||||
if(filter.acceptByNonQueryCriteria(m_books.at(id))) {
|
if(filter.accept(m_books.at(id))) {
|
||||||
result.push_back(id);
|
result.push_back(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -596,7 +596,7 @@ bool Filter::hasQuery() const
|
||||||
return ACTIVE(QUERY);
|
return ACTIVE(QUERY);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Filter::acceptByNonQueryCriteria(const Book& book) const
|
bool Filter::accept(const Book& book) const
|
||||||
{
|
{
|
||||||
auto local = !book.getPath().empty();
|
auto local = !book.getPath().empty();
|
||||||
FILTER(_LOCAL, local)
|
FILTER(_LOCAL, local)
|
||||||
|
|
Loading…
Reference in New Issue