old render cleanup part 3
This commit is contained in:
45 files changed
+1057
-1135
No files matched your search
@@ -11,20 +11,24 @@ BookPosition BookPositionStore::load(const QByteArray &contentMd5)
|
||||
return {};
|
||||
const QVariantMap d = m_state.loadSection(sectionKey(contentMd5));
|
||||
BookPosition pos;
|
||||
pos.chunkIndex = d.value(QStringLiteral("chunkIndex"), 0).toInt();
|
||||
pos.pageShift = d.value(QStringLiteral("pageShift"), true).toBool();
|
||||
pos.mangaRTL = d.value(QStringLiteral("mangaRTL"), true).toBool();
|
||||
pos.chapterIndex = d.value(QStringLiteral("chapterIndex"), 0).toInt();
|
||||
pos.chunkIndex = d.value(QStringLiteral("chunkIndex"), 0).toInt();
|
||||
pos.progress = d.value(QStringLiteral("progress"), 0.0).toReal();
|
||||
pos.pageShift = d.value(QStringLiteral("pageShift"), true).toBool();
|
||||
pos.mangaRTL = d.value(QStringLiteral("mangaRTL"), true).toBool();
|
||||
return pos;
|
||||
}
|
||||
|
||||
void BookPositionStore::save(const QByteArray &contentMd5, int chunkIndex, bool mangaRTL, bool pageShift)
|
||||
void BookPositionStore::save(const QByteArray &contentMd5, const BookPosition &pos)
|
||||
{
|
||||
if (contentMd5.isEmpty())
|
||||
return;
|
||||
m_state.saveSection(sectionKey(contentMd5), {
|
||||
{QStringLiteral("chunkIndex"), chunkIndex},
|
||||
{QStringLiteral("pageShift"), pageShift},
|
||||
{QStringLiteral("mangaRTL"), mangaRTL},
|
||||
{QStringLiteral("chapterIndex"), pos.chapterIndex},
|
||||
{QStringLiteral("chunkIndex"), pos.chunkIndex},
|
||||
{QStringLiteral("progress"), pos.progress},
|
||||
{QStringLiteral("pageShift"), pos.pageShift},
|
||||
{QStringLiteral("mangaRTL"), pos.mangaRTL},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user