Some refactor

This commit is contained in:
Agel committed 2026-04-08 14:01:03 +02:00
1 parent 7ecb7f4f4f
commit 9280c838b2
37 files changed
+1599 -981

No files matched your search

+7 -7
View File
@@ -7,9 +7,11 @@
#include <cmath>
#include <QtConcurrent>
#include "AppState.h"
ReadingModel::ReadingModel(QObject *parent) : QAbstractListModel(parent) {}
ReadingModel::ReadingModel(BookPositionStore &positions, QObject *parent)
: QAbstractListModel(parent)
, m_positions(positions)
{
}
ReadingModel::~ReadingModel()
{
@@ -126,10 +128,8 @@ void ReadingModel::runMeasurement(const QStringList &htmls, const bool isNew)
{PixelHeightRole});
if (isNew) {
QVariantMap map = AppState::loadBookPosition(m_reader->filePath());
int savedChunk = map.value(QStringLiteral("chunkIndex"), 0).toInt();
qreal savedIntra = map.value(QStringLiteral("intraChunkOffset"), 0).toInt();
restoreReady(savedChunk, savedIntra);
const auto pos = m_positions.load(m_reader->contentHash());
emit restoreReady(pos.chunkIndex, pos.intraOffset);
}
}, Qt::QueuedConnection);
});