diff --git a/include/library.h b/include/library.h index 3470438d3..064b302c2 100644 --- a/include/library.h +++ b/include/library.h @@ -49,7 +49,6 @@ class Book ~Book(); bool update(const Book& other); - static bool sortByLastOpen(const Book& a, const Book& b); static bool sortByTitle(const Book& a, const Book& b); static bool sortBySize(const Book& a, const Book& b); static bool sortByDate(const Book& a, const Book& b); @@ -61,7 +60,6 @@ class Book bool readOnly() const { return m_readOnly; } const string& id() const { return m_id; } const string& path() const { return m_path; } - const string& last() const { return m_last; } const string& indexPath() const { return m_indexPath; } const supportedIndexType& indexType() const { return m_indexType; } const string& title() const { return m_title; } @@ -83,7 +81,6 @@ class Book void setReadOnly(bool readOnly) { m_readOnly = readOnly; } void setId(const std::string& id) { m_id = id; } void setPath(const std::string& path); - void setLast(const std::string& last) { m_last = last; } void setIndexPath(const std::string& indexPath); void setIndexType(supportedIndexType indexType) { m_indexType = indexType;} void setTitle(const std::string& title) { m_title = title; } @@ -105,7 +102,6 @@ class Book protected: string m_id; string m_path; - string m_last; string m_indexPath; supportedIndexType m_indexType; string m_title; diff --git a/src/library.cpp b/src/library.cpp index 9e88a3868..65fc628a3 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -32,10 +32,6 @@ Book::~Book() { } /* Sort functions */ -bool Book::sortByLastOpen(const kiwix::Book& a, const kiwix::Book& b) -{ - return atoi(a.last.c_str()) > atoi(b.last.c_str()); -} bool Book::sortByTitle(const kiwix::Book& a, const kiwix::Book& b) { return a.m_title < b.m_title; diff --git a/src/manager.cpp b/src/manager.cpp index bd78edf16..36fc6f74b 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -53,9 +53,6 @@ bool Manager::parseXmlDom(const pugi::xml_document& doc, removeLastPathElement(libraryPath, true, false), path); } book.setPath(path); - book.setLast(std::string(bookNode.attribute("last").value()) != "undefined" - ? bookNode.attribute("last").value() - : ""); std::string indexPath = bookNode.attribute("indexPath").value(); if (isRelativePath(indexPath)) { indexPath = computeAbsolutePath( @@ -288,18 +285,6 @@ bool Manager::removeBookById(const string id) { return library.removeBookById(id); } - -bool Manager::updateBookLastOpenDateById(const string id) -try { - auto book = library.getBookById(id); - char unixdate[12]; - sprintf(unixdate, "%d", (int)time(NULL)); - book.last = unixdate; - return true; -} catch(...) { - return false; -} - bool Manager::setBookIndex(const string id, const string path, const supportedIndexType type)