Remove obsolete BookController files and update documentation
BookController was superseded by the Book class during a prior refactoring. The old files were never removed and are not in CMakeLists.txt. Deleted: - src/backend/BookController.h/cpp (not in build, calls non-existent AppState APIs) - tests/BookControllerTest.cpp (not in CMake test targets) Updated CLAUDE.md architecture documentation to reference Book instead of BookController for all book management operations and tests. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
4 files changed
+8
-658
No files matched your search
@@ -131,7 +131,7 @@ When `CMakeLists.txt` gains a new `find_package` or `pkg_check_modules` dependen
|
||||
|
||||
| Object | Responsibility |
|
||||
|---|---|
|
||||
| `BookController` | Open/close book, owns reader (via `ReaderFactory`), exposes metadata (title, author), TOC |
|
||||
| `Book` | Open/close book, owns reader (via `ReaderFactory`), exposes metadata (title, author), TOC |
|
||||
| `ReadingModel` | QAbstractListModel exposing chapter chunks (ContentRole), position, next/prev navigation, progress |
|
||||
| `AppState` | Window geometry, last file, preferences (`QSettings`) |
|
||||
|
||||
@@ -175,11 +175,11 @@ Chapter mapping by format: TXT = 1 chapter (whole file). FB2 = `<section>` eleme
|
||||
|
||||
### Async Book Opening
|
||||
|
||||
`BookController::openBook(path)` runs reader creation + metadata loading in `QtConcurrent::run()`. Emits `bookReady()` or `bookError(QString)` when done.
|
||||
`Book::openBook()` runs reader creation + metadata loading in `QtConcurrent::run()`. Emits `bookReady()` or `bookError(QString)` when done.
|
||||
|
||||
### Error Handling
|
||||
|
||||
`FormatReader::open()` returns `bool`. Failed readers expose `QString lastError()`. `BookController` translates errors to a `QString errorMessage` property + `error(QString)` signal. QML shows an `ErrorPopup.qml` component. Error cases: file not found, unsupported format, corrupt archive, encoding failure, permission denied.
|
||||
`FormatReader::open()` returns `bool`. Failed readers expose `QString lastError()`. `Book` translates errors to a `QString errorMessage` property + `error(QString)` signal. QML shows an `ErrorPopup.qml` component. Error cases: file not found, unsupported format, corrupt archive, encoding failure, permission denied.
|
||||
|
||||
### File Structure
|
||||
|
||||
@@ -187,7 +187,8 @@ Chapter mapping by format: TXT = 1 chapter (whole file). FB2 = `<section>` eleme
|
||||
src/
|
||||
main.cpp
|
||||
backend/
|
||||
BookController.h/cpp # Open/close, metadata, TOC — exposed to QML
|
||||
book/
|
||||
Book.h/cpp # Open/close, metadata, TOC — exposed to QML
|
||||
ReadingModel.h/cpp # Chapter content, position, navigation — exposed to QML
|
||||
AppState.h/cpp # Window/session state (QSettings) — exposed to QML
|
||||
FormatReader.h # Abstract interface + Chapter/TocEntry structs
|
||||
@@ -209,7 +210,7 @@ src/
|
||||
Main.qml
|
||||
components/
|
||||
Header.qml
|
||||
SideBar.qml # Renders TOC from BookController
|
||||
SideBar.qml # Renders TOC from Book
|
||||
PageView.qml # ListView-based virtualized rendering of ReadingModel chunks
|
||||
Footer.qml
|
||||
ErrorPopup.qml # Error display popup
|
||||
@@ -222,7 +223,8 @@ tests/
|
||||
TxtReaderTest.cpp
|
||||
Fb2ReaderTest.cpp
|
||||
EpubReaderTest.cpp
|
||||
BookControllerTest.cpp
|
||||
book/
|
||||
BookTest.cpp
|
||||
ReadingModelTest.cpp
|
||||
AppStateTest.cpp
|
||||
fixtures/
|
||||
|
||||
Reference in new issue
Block a user