added txt support

This commit is contained in:
Agel committed 2026-03-15 21:33:18 +01:00
1 parent 3c0037cfc9
commit 64a70bc4cf
22 files changed
+800 -186

No files matched your search

+2 -7
View File
@@ -8,7 +8,7 @@ Asteria Qt is a cross-platform desktop book/document reader built with Qt6/C++.
**Target platforms:** Windows and Linux (both required from day one); macOS planned
**Current dev environment:** Linux
**Feature tier:** Minimal reader — open, read, bookmarks
**Feature tier:** Minimal reader — open, read
### Format Support
@@ -101,7 +101,7 @@ ctest --test-dir build --output-on-failure
- Tests live in `tests/` mirroring the `src/backend/` structure (e.g., `tests/formats/TxtReaderTest.cpp`)
- Use `Qt Test` (`QTest`) framework — include `find_package(Qt6 REQUIRED COMPONENTS Test)` in CMakeLists
- Each format reader must have a test that loads a real sample file from `tests/fixtures/`
- `BookController`, `ReadingModel`, `BookmarkModel`, `BookmarkStore`, and `AppState` must each have unit tests
- `BookController`, `ReadingModel`, and `AppState` must each have unit tests
- QML-only UI code is exempt from TDD; backend logic extracted to C++ is not
- Run `ctest --test-dir build --output-on-failure` before considering any task complete
@@ -115,7 +115,6 @@ ctest --test-dir build --output-on-failure
|---|---|
| `BookController` | Open/close book, owns reader (via `ReaderFactory`), exposes metadata (title, author), TOC |
| `ReadingModel` | Current chapter content, position, next/prev navigation, progress % |
| `BookmarkModel` | Bookmark CRUD for the current book (wraps `BookmarkStore`) |
| `AppState` | Window geometry, last file, preferences (`QSettings`) |
Sidebar state, header state, etc. stay as pure QML properties — no C++ needed.
@@ -170,8 +169,6 @@ src/
backend/
BookController.h/cpp # Open/close, metadata, TOC — exposed to QML
ReadingModel.h/cpp # Chapter content, position, navigation — exposed to QML
BookmarkModel.h/cpp # Bookmark CRUD — exposed to QML
BookmarkStore.h/cpp # Persistence layer (QSettings)
AppState.h/cpp # Window/session state (QSettings) — exposed to QML
FormatReader.h # Abstract interface + Chapter/TocEntry structs
ReaderFactory.h/cpp # Extension → reader mapping
@@ -207,8 +204,6 @@ tests/
EpubReaderTest.cpp
BookControllerTest.cpp
ReadingModelTest.cpp
BookmarkModelTest.cpp
BookmarkStoreTest.cpp
AppStateTest.cpp
fixtures/
sample.txt