Refactor using Fable

This commit is contained in:
Agel committed 2026-07-31 17:31:02 +02:00
1 parent 1a60a6b93c
commit 83968646c6
90 files changed
+2080 -2267

No files matched your search

+7 -5
View File
@@ -6,7 +6,7 @@
#include "backend/AppState.h"
#include "backend/IFileDialogService.h"
#include "backend/formats/ReaderFactory.h"
#include "backend/formats/FormatRegistry.h"
#include "backend/formats/TxtReader.h"
#include "backend/formats/EpubReader.h"
#include "backend/state/BookPositionStore.h"
@@ -49,7 +49,7 @@ private:
AppState *appState = nullptr;
BookPositionStore *store = nullptr;
FakeDialogService *dialog = nullptr;
ReaderFactory *factory = nullptr;
FormatRegistry *factory = nullptr;
Book *book = nullptr;
Ctx() {
@@ -59,9 +59,11 @@ private:
appState = new AppState(*s);
store = new BookPositionStore(*appState);
dialog = new FakeDialogService;
factory = new ReaderFactory({
[] { return std::make_unique<TxtReader>(); },
[] { return std::make_unique<EpubReader>(); },
factory = new FormatRegistry({
{QStringLiteral("txt"), false, {},
[] { return std::make_unique<TxtReader>(); }, nullptr},
{QStringLiteral("epub"), false, QStringLiteral("epub"),
[] { return std::make_unique<EpubReader>(); }, nullptr},
});
book = new Book(*dialog, *store, *factory);
}