| 58 | } |
| 59 | |
| 60 | bool RecentBooksStore::removeByPath(const std::string& path) { |
| 61 | auto it = |
| 62 | std::find_if(recentBooks.begin(), recentBooks.end(), [&](const RecentBook& book) { return book.path == path; }); |
| 63 | if (it == recentBooks.end()) { |
| 64 | return false; |
| 65 | } |
| 66 | recentBooks.erase(it); |
| 67 | if (!saveToFile()) { |
| 68 | LOG_ERR("RBS", "Failed to persist removal of recent book: %s", path.c_str()); |
| 69 | } |
| 70 | return true; |
| 71 | } |
| 72 | |
| 73 | void RecentBooksStore::updatePath(const std::string& oldPath, const std::string& newPath, |
| 74 | const std::string& oldCachePath, const std::string& newCachePath) { |
no test coverage detected