diff --git a/include/library.h b/include/library.h index 0497e5a5c..4c629874b 100644 --- a/include/library.h +++ b/include/library.h @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -171,7 +170,6 @@ class Library */ std::vector getBooksIds(); - stack current; friend class OPDSDumper; }; } diff --git a/include/manager.h b/include/manager.h index abbbd8e7d..4ac7e260a 100644 --- a/include/manager.h +++ b/include/manager.h @@ -115,22 +115,6 @@ class Manager */ bool removeBookById(const string id); - /** - * Set the current book. - * - * @param id The id to add to the stack of current books. - * If id is empty, remove the current book from the stack. - * @return True - */ - bool setCurrentBookId(const string id); - - /** - * Get the current book id. - * - * @return The id of the current book (or empty string if no current book). - */ - string getCurrentBookId() const; - /** * Set the path of the external fulltext index associated to a book. * @@ -193,14 +177,6 @@ class Manager */ bool getBookById(const string id, Book& book); - /** - * Get the current book. - * - * @param[out] The current book. - * @return True if there is a current book. - */ - bool getCurrentBook(Book& book); - /** * Update the "last open date" of a book * diff --git a/src/manager.cpp b/src/manager.cpp index f7a502cc1..7e6648f83 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -36,9 +36,6 @@ bool Manager::parseXmlDom(const pugi::xml_document& doc, { pugi::xml_node libraryNode = doc.child("library"); - if (strlen(libraryNode.attribute("current").value())) - this->setCurrentBookId(libraryNode.attribute("current").value()); - string libraryVersion = libraryNode.attribute("version").value(); for (pugi::xml_node bookNode = libraryNode.child("book"); bookNode; @@ -195,23 +192,6 @@ bool Manager::readFile(const string nativePath, } -bool Manager::setCurrentBookId(const string id) -{ - if (library.current.empty() || library.current.top() != id) { - if (id.empty() && !library.current.empty()) { - library.current.pop(); - } else { - library.current.push(id); - } - } - return true; -} - -string Manager::getCurrentBookId() const -{ - return library.current.empty() ? "" : library.current.top(); -} - /* Add a book to the library. Return empty string if failed, book id otherwise */ string Manager::addBookFromPathAndGetId(const string pathToOpen, @@ -315,17 +295,6 @@ bool Manager::removeBookById(const string id) return library.removeBookById(id); } -bool Manager::getCurrentBook(Book& book) -{ - string currentBookId = getCurrentBookId(); - if (currentBookId.empty()) { - return false; - } else { - book = library.getBookById(currentBookId); - return true; - } -} - bool Manager::updateBookLastOpenDateById(const string id) try { auto book = library.getBookById(id);