Nitpick comments
This commit is contained in:
@@ -144,17 +144,7 @@ void EpubReaderActivity::loop() {
|
|||||||
startActivityForResult(
|
startActivityForResult(
|
||||||
std::make_unique<KOReaderSyncActivity>(renderer, mappedInput, epub, epub->getPath(), currentSpineIndex,
|
std::make_unique<KOReaderSyncActivity>(renderer, mappedInput, epub, epub->getPath(), currentSpineIndex,
|
||||||
currentPage, totalPages),
|
currentPage, totalPages),
|
||||||
[this](const ActivityResult& result) {
|
[this](const ActivityResult& result) { handleSyncResult(result); });
|
||||||
if (!result.isCancelled) {
|
|
||||||
const auto& sync = std::get<SyncResult>(result.data);
|
|
||||||
if (currentSpineIndex != sync.spineIndex || (section && section->currentPage != sync.page)) {
|
|
||||||
RenderLock lock(*this);
|
|
||||||
currentSpineIndex = sync.spineIndex;
|
|
||||||
nextPageNumber = sync.page;
|
|
||||||
section.reset();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -411,23 +401,25 @@ void EpubReaderActivity::onReaderMenuConfirm(EpubReaderMenuActivity::MenuAction
|
|||||||
startActivityForResult(
|
startActivityForResult(
|
||||||
std::make_unique<KOReaderSyncActivity>(renderer, mappedInput, epub, epub->getPath(), currentSpineIndex,
|
std::make_unique<KOReaderSyncActivity>(renderer, mappedInput, epub, epub->getPath(), currentSpineIndex,
|
||||||
currentPage, totalPages),
|
currentPage, totalPages),
|
||||||
[this](const ActivityResult& result) {
|
[this](const ActivityResult& result) { handleSyncResult(result); });
|
||||||
if (!result.isCancelled) {
|
|
||||||
const auto& sync = std::get<SyncResult>(result.data);
|
|
||||||
if (currentSpineIndex != sync.spineIndex || (section && section->currentPage != sync.page)) {
|
|
||||||
RenderLock lock(*this);
|
|
||||||
currentSpineIndex = sync.spineIndex;
|
|
||||||
nextPageNumber = sync.page;
|
|
||||||
section.reset();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EpubReaderActivity::handleSyncResult(const ActivityResult& result) {
|
||||||
|
if (!result.isCancelled) {
|
||||||
|
const auto& sync = std::get<SyncResult>(result.data);
|
||||||
|
if (currentSpineIndex != sync.spineIndex || (section && section->currentPage != sync.page)) {
|
||||||
|
RenderLock lock(*this);
|
||||||
|
currentSpineIndex = sync.spineIndex;
|
||||||
|
nextPageNumber = sync.page;
|
||||||
|
section.reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void EpubReaderActivity::applyOrientation(const uint8_t orientation) {
|
void EpubReaderActivity::applyOrientation(const uint8_t orientation) {
|
||||||
// No-op if the selected orientation matches current settings.
|
// No-op if the selected orientation matches current settings.
|
||||||
if (SETTINGS.orientation == orientation) {
|
if (SETTINGS.orientation == orientation) {
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ class EpubReaderActivity final : public Activity {
|
|||||||
// Jump to a percentage of the book (0-100), mapping it to spine and page.
|
// Jump to a percentage of the book (0-100), mapping it to spine and page.
|
||||||
void jumpToPercent(int percent);
|
void jumpToPercent(int percent);
|
||||||
void onReaderMenuConfirm(EpubReaderMenuActivity::MenuAction action);
|
void onReaderMenuConfirm(EpubReaderMenuActivity::MenuAction action);
|
||||||
|
void handleSyncResult(const ActivityResult& result);
|
||||||
void applyOrientation(uint8_t orientation);
|
void applyOrientation(uint8_t orientation);
|
||||||
void toggleAutoPageTurn(uint8_t selectedPageTurnOption);
|
void toggleAutoPageTurn(uint8_t selectedPageTurnOption);
|
||||||
void pageTurn(bool isForwardTurn);
|
void pageTurn(bool isForwardTurn);
|
||||||
|
|||||||
Reference in New Issue
Block a user