Refactor using Fable
This commit is contained in:
90 files changed
+2080
-2267
No files matched your search
@@ -10,7 +10,7 @@
|
||||
|
||||
#include "backend/FormatReader.h"
|
||||
#include "backend/IFileDialogService.h"
|
||||
#include "backend/formats/ReaderFactory.h"
|
||||
#include "backend/formats/FormatRegistry.h"
|
||||
#include "backend/state/BookPositionStore.h"
|
||||
|
||||
class Book : public QObject {
|
||||
@@ -23,11 +23,10 @@ class Book : public QObject {
|
||||
Q_PROPERTY(QString coverImageUrl READ coverImageUrl NOTIFY bookChanged)
|
||||
Q_PROPERTY(QList<TocEntry> toc READ toc NOTIFY bookChanged)
|
||||
Q_PROPERTY(QString errorMessage READ errorMessage NOTIFY errorMessageChanged)
|
||||
Q_PROPERTY(QString renderingMode READ renderingMode NOTIFY renderingModeChanged)
|
||||
public:
|
||||
Book(IFileDialogService &dialog,
|
||||
BookPositionStore &positions,
|
||||
ReaderFactory &factory,
|
||||
FormatRegistry ®istry,
|
||||
QObject *parent = nullptr);
|
||||
~Book() override;
|
||||
|
||||
@@ -39,9 +38,8 @@ public:
|
||||
QString coverImageUrl() const;
|
||||
QList<TocEntry> toc() const;
|
||||
QString errorMessage() const;
|
||||
QString renderingMode() const;
|
||||
|
||||
// Called by main.cpp's bookChanged lambda after the image provider resolves the cover URL.
|
||||
// Called by AppCoordinator::onBookChanged after the image provider resolves the cover URL.
|
||||
void setCoverImageUrl(const QString &url);
|
||||
|
||||
// Access the underlying reader for wiring purposes (e.g., to push into ReadingModel).
|
||||
@@ -69,7 +67,6 @@ signals:
|
||||
void bookChanged();
|
||||
void loadingChanged();
|
||||
void errorMessageChanged();
|
||||
void renderingModeChanged();
|
||||
void contentWidthChanged(int width);
|
||||
|
||||
private:
|
||||
@@ -77,11 +74,10 @@ private:
|
||||
|
||||
IFileDialogService &m_dialog;
|
||||
BookPositionStore &m_positions;
|
||||
ReaderFactory &m_factory;
|
||||
FormatRegistry &m_registry;
|
||||
std::unique_ptr<FormatReader> m_reader;
|
||||
QString m_coverImageUrl;
|
||||
QString m_errorMessage;
|
||||
QString m_renderingMode = QStringLiteral("scroll");
|
||||
bool m_loading = false;
|
||||
int m_openGeneration = 0;
|
||||
int m_contentWidth = 0;
|
||||
|
||||
Reference in new issue
Block a user