mirror of https://github.com/kiwix/libkiwix.git
+ code to pupulate publisher list in the content manager
This commit is contained in:
parent
8b5559af2b
commit
5cd20c8fa7
|
@ -345,6 +345,22 @@ namespace kiwix {
|
||||||
return booksLanguages;
|
return booksLanguages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vector<string> Manager::getBooksPublishers() {
|
||||||
|
std::vector<string> booksPublishers;
|
||||||
|
std::vector<kiwix::Book>::iterator itr;
|
||||||
|
std::map<string, bool> booksPublishersMap;
|
||||||
|
|
||||||
|
std::sort(library.books.begin(), library.books.end(), kiwix::Book::sortByPublisher);
|
||||||
|
for ( itr = library.books.begin(); itr != library.books.end(); ++itr ) {
|
||||||
|
if (booksPublishersMap.find(itr->creator) == booksPublishersMap.end()) {
|
||||||
|
booksPublishersMap[itr->creator] = true;
|
||||||
|
booksPublishers.push_back(itr->creator);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return booksPublishers;
|
||||||
|
}
|
||||||
|
|
||||||
kiwix::Library Manager::cloneLibrary() {
|
kiwix::Library Manager::cloneLibrary() {
|
||||||
return this->library;
|
return this->library;
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,6 +65,7 @@ namespace kiwix {
|
||||||
void removeBookPaths();
|
void removeBookPaths();
|
||||||
bool listBooks(const supportedListMode mode, const supportedListSortBy sortBy, const unsigned int maxSize);
|
bool listBooks(const supportedListMode mode, const supportedListSortBy sortBy, const unsigned int maxSize);
|
||||||
vector<string> getBooksLanguages();
|
vector<string> getBooksLanguages();
|
||||||
|
vector<string> getBooksPublishers();
|
||||||
|
|
||||||
string writableLibraryPath;
|
string writableLibraryPath;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue