Refactor using Fable
This commit is contained in:
90 files changed
+2080
-2267
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user