Remove obsolete TODO comments and clarify code

Clean up outdated TODO comments that are no longer relevant and improve comment clarity in activity classes and parsers.
This commit is contained in:
Justin Mitchell
2026-06-19 15:54:44 -04:00
parent 57c389c0b6
commit 1511ab35d5
15 changed files with 6 additions and 26 deletions
-1
View File
@@ -3,7 +3,6 @@
#include <FreeInkUI.h>
#include <GfxRenderer.h>
#include <algorithm>
#include <cstdlib>
#include "CrossPointSettings.h"
+1 -2
View File
@@ -56,8 +56,7 @@ class Activity {
// Finish this activity and return to the previous one on the stack (if any)
void finish();
// Convenience method to facilitate API transition to ActivityManager
// TODO: remove this in near future
// Convenience method to facilitate API transition to ActivityManager.
void onGoHome(HomeMenuItem item = HomeMenuItem::NONE);
void onSelectBook(const std::string& path);
};
@@ -33,7 +33,6 @@ void OpdsBookBrowserActivity::onEnter() {
currentPath = "";
selectorIndex = 0;
consumeConfirm = false;
consumeBack = false;
errorMessage.clear();
statusMessage = tr(STR_CHECKING_WIFI);
requestUpdate();
@@ -62,10 +61,6 @@ void OpdsBookBrowserActivity::loop() {
consumeConfirm = false;
return;
}
if (consumeBack && mappedInput.wasReleased(MappedInputManager::Button::Back)) {
consumeBack = false;
return;
}
if (state == BrowserState::ERROR) {
if (mappedInput.wasReleased(MappedInputManager::Button::Confirm)) {
@@ -33,7 +33,6 @@ class OpdsBookBrowserActivity final : public Activity {
std::string currentPath;
std::string searchTemplate;
bool consumeConfirm = false;
bool consumeBack = false; // Added missing member
int selectorIndex = 0;
std::string errorMessage;
std::string statusMessage;
@@ -51,7 +51,6 @@ void NetworkModeSelectionActivity::loop() {
return;
}
// Handle navigation
buttonNavigator.onNext([this] {
selectedIndex = ButtonNavigator::nextIndex(selectedIndex, MENU_ITEM_COUNT);
requestUpdate();
@@ -86,7 +85,6 @@ void NetworkModeSelectionActivity::render(RenderLock&&) {
[](int index) { return std::string(I18N.get(menuItems[index])); },
[](int index) { return std::string(I18N.get(menuDescs[index])); }, [](int index) { return menuIcons[index]; });
// Draw help text at bottom
const auto labels = mappedInput.mapLabels(tr(STR_BACK), tr(STR_SELECT), tr(STR_DIR_UP), tr(STR_DIR_DOWN));
GUI.drawButtonHints(renderer, labels.btn1, labels.btn2, labels.btn3, labels.btn4);
@@ -463,7 +463,6 @@ void WifiSelectionActivity::loop() {
}
}
// Handle navigation
buttonNavigator.onNext([this] {
selectedNetworkIndex = ButtonNavigator::nextIndex(selectedNetworkIndex, networks.size());
requestUpdate();
@@ -723,7 +723,6 @@ void EpubReaderActivity::pageTurn(bool isForwardTurn) {
requestUpdate();
}
// TODO: Failure handling
void EpubReaderActivity::render(RenderLock&& lock) {
if (!epub) {
return;
@@ -20,7 +20,11 @@ void EpubReaderFootnotesActivity::onEnter() {
void EpubReaderFootnotesActivity::onExit() { Activity::onExit(); }
void EpubReaderFootnotesActivity::loop() {
const int visibleCount = std::max(1, renderer.getScreenHeight() / 36);
constexpr int lineHeight = 36;
const auto orientation = renderer.getOrientation();
const bool isPortraitInverted = orientation == GfxRenderer::Orientation::PortraitInverted;
const int contentY = isPortraitInverted ? 50 : 0;
const int visibleCount = std::max(1, (renderer.getScreenHeight() - contentY) / lineHeight);
if (mappedInput.wasListScroll(selectedIndex, static_cast<int>(footnotes.size()), visibleCount)) {
requestUpdate();
return;
@@ -46,7 +46,6 @@ void EpubReaderMenuActivity::onEnter() {
void EpubReaderMenuActivity::onExit() { Activity::onExit(); }
void EpubReaderMenuActivity::loop() {
// Handle navigation
buttonNavigator.onNext([this] {
selectedIndex = ButtonNavigator::nextIndex(selectedIndex, static_cast<int>(menuItems.size()));
requestUpdate();
@@ -52,7 +52,6 @@ void KOReaderSettingsActivity::loop() {
return;
}
// Handle navigation
buttonNavigator.onNext([this] {
selectedIndex = (selectedIndex + 1) % MENU_ITEMS;
requestUpdate();
@@ -156,7 +155,6 @@ void KOReaderSettingsActivity::render(RenderLock&&) {
},
true);
// Draw help text at bottom
const auto labels = mappedInput.mapLabels(tr(STR_BACK), tr(STR_SELECT), tr(STR_DIR_UP), tr(STR_DIR_DOWN));
GUI.drawButtonHints(renderer, labels.btn1, labels.btn2, labels.btn3, labels.btn4);
@@ -57,7 +57,6 @@ void LanguageSelectActivity::loop() {
return;
}
// Handle navigation
buttonNavigator.onNextRelease([this] {
selectedIndex = ButtonNavigator::nextIndex(static_cast<int>(selectedIndex), totalItems);
requestUpdate();
@@ -189,7 +189,6 @@ void SettingsActivity::loop() {
return;
}
// Handle navigation
buttonNavigator.onNextRelease([this] {
selectedSettingIndex = ButtonNavigator::nextIndex(selectedSettingIndex, settingsCount + 1);
requestUpdate();
@@ -429,7 +428,6 @@ void SettingsActivity::render(RenderLock&&) {
},
true);
// Draw help text
const auto confirmLabel =
(selectedSettingIndex == 0)
? I18N.get(categoryNames[(selectedCategoryIndex + 1) % categoryCount])
@@ -150,7 +150,6 @@ void StatusBarSettingsActivity::loop() {
return;
}
// Handle navigation
buttonNavigator.onNextRelease([this] {
selectedIndex = ButtonNavigator::nextIndex(selectedIndex, visibleItemCount);
requestUpdate();
@@ -107,13 +107,9 @@ void BmpViewerActivity::onEnter() {
GUI.fillPopupProgress(renderer, popupRect, 50);
renderer.clearScreen();
// Assuming drawBitmap defaults to 0,0 crop if omitted, or pass explicitly: drawBitmap(bitmap, x, y, pageWidth,
// pageHeight, 0, 0)
renderer.drawBitmap(bitmap, x, y, pageWidth, pageHeight, 0, 0);
// Draw UI hints on the base layer
GUI.drawButtonHints(renderer, labels.btn1, labels.btn2, labels.btn3, labels.btn4);
// Single pass for non-grayscale images
renderer.displayBuffer(HalDisplay::FAST_REFRESH);