From 54cb99d0748772ed6630f8934247f87e6854147b Mon Sep 17 00:00:00 2001 From: kelson42 Date: Mon, 16 Apr 2012 22:48:12 +0000 Subject: [PATCH] + add unaccent.[c[[|h] to Makefile.am + fix some regression added few hours ago --- src/common/kiwix/library.cpp | 3 ++- src/common/kiwix/manager.cpp | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/common/kiwix/library.cpp b/src/common/kiwix/library.cpp index 080b5e6ce..7e9ec1a2c 100644 --- a/src/common/kiwix/library.cpp +++ b/src/common/kiwix/library.cpp @@ -60,7 +60,8 @@ namespace kiwix { } std::string Book::getHumanReadableIdFromPath() { - std::string id = removeAccents(path); + std::string id = path; + removeAccents(id); replaceRegex(id, "", "^.*/"); replaceRegex(id, "", "\\.zim[a-z]*$"); replaceRegex(id, "_", " "); diff --git a/src/common/kiwix/manager.cpp b/src/common/kiwix/manager.cpp index a90cc01a4..e8f460297 100644 --- a/src/common/kiwix/manager.cpp +++ b/src/common/kiwix/manager.cpp @@ -311,6 +311,23 @@ namespace kiwix { return booksLanguages; } + vector Manager::getBooksCreators() { + std::vector booksCreators; + std::vector::iterator itr; + std::map booksCreatorsMap; + + std::sort(library.books.begin(), library.books.end(), kiwix::Book::sortByCreator); + for ( itr = library.books.begin(); itr != library.books.end(); ++itr ) { + if (booksCreatorsMap.find(itr->creator) == booksCreatorsMap.end()) { + booksCreatorsMap[itr->creator] = true; + booksCreators.push_back(itr->creator); + } + } + + return booksCreators; + } + + vector Manager::getBooksIds() { std::vector booksIds; std::vector::iterator itr;