From 22a8e0c42ff45a927cf8ad02e965d0f5afa74cf8 Mon Sep 17 00:00:00 2001 From: Zando <151206451+LZando@users.noreply.github.com> Date: Thu, 29 Jan 2026 20:39:31 +0100 Subject: [PATCH] Delete src/RecentBooksStore.h --- src/RecentBooksStore.h | 49 ------------------------------------------ 1 file changed, 49 deletions(-) delete mode 100644 src/RecentBooksStore.h diff --git a/src/RecentBooksStore.h b/src/RecentBooksStore.h deleted file mode 100644 index 3574063f..00000000 --- a/src/RecentBooksStore.h +++ /dev/null @@ -1,49 +0,0 @@ -#pragma once -#include -#include - -struct RecentBook { - std::string path; - std::string title; - std::string author; - - bool operator==(const RecentBook& other) const { return path == other.path; } -}; - -class RecentBooksStore { - // Static instance - static RecentBooksStore instance; - - std::vector recentBooks; - - public: - ~RecentBooksStore() = default; - - // Get singleton instance - static RecentBooksStore& getInstance() { return instance; } - - // Add a book to the recent list (moves to front if already exists) - void addBook(const std::string& path, const std::string& title, const std::string& author); - - // Get the list of recent books (most recent first) - const std::vector& getBooks() const { return recentBooks; } - - // Get the count of recent books - int getCount() const { return static_cast(recentBooks.size()); } - - bool saveToFile() const; - bool loadFromFile(); - - /** - * Update the path of a book in the recent list. - * Useful when moving/renaming files or entire directories. - * If oldPath is a directory, all books within will have their paths updated. - * - * @param oldPath Original absolute path - * @param newPath New absolute path - */ - void updatePath(const std::string& oldPath, const std::string& newPath); -}; - -// Helper macro to access recent books store -#define RECENT_BOOKS RecentBooksStore::getInstance()