fix history book positions

This commit is contained in:
Agel committed 2026-04-17 12:28:03 +02:00
1 parent f80fefa34f
commit 8879fa9aba
5 files changed
+9 -1

No files matched your search

+1
View File
@@ -94,6 +94,7 @@ void HistoryModel::addOrUpdateBook(const QString &filePath, double progress, con
m_books.move(i, 0);
endMoveRows();
}
emit dataChanged(createIndex(0, 0), createIndex(0, 0), {ProgressRole, LastOpenedRole});
return;
}
}
+1 -1
View File
@@ -61,7 +61,7 @@ qreal ReadingModel::totalPixelHeight() const { return m_totalPixelHeight; }
double ReadingModel::progress() const
{
return qBound(0, static_cast<int>(m_yOffset * 100), 100);
return qBound(0.0, m_yOffset, 1.0);
}
int ReadingModel::currentPage() const { return m_currentPage; }
+1
View File
@@ -138,6 +138,7 @@ void Book::saveCurrentPosition(int chunkIndex, int intraOffset)
{
if (!m_reader) return;
m_positions.save(m_reader->contentHash(), chunkIndex, intraOffset);
emit positionSaved();
}
void Book::setContentWidth(int width)
+1
View File
@@ -62,6 +62,7 @@ signals:
// Emitted just before replacing the current reader with a new one.
// Listeners can snapshot the outgoing book's progress before the swap.
void willOpenNewBook();
void positionSaved();
void bookChanged();
void loadingChanged();