Refactor ActivityManager calls

This commit is contained in:
jpirnay
2026-04-17 20:23:42 +02:00
parent ef088db789
commit b4881e1563
12 changed files with 156 additions and 45 deletions
+15 -1
View File
@@ -8,6 +8,7 @@
#include <algorithm>
#include "../ActivityManager.h"
#include "../util/ConfirmationActivity.h"
#include "BookInfoActivity.h"
#include "CrossPointSettings.h"
@@ -113,6 +114,14 @@ void FileBrowserActivity::onEnter() {
loadFiles();
selectorIndex = 0;
if (!focusName.empty()) {
const size_t idx = findEntry(focusName);
if (idx < files.size()) {
selectorIndex = idx;
}
focusName.clear();
}
requestUpdate();
}
@@ -171,7 +180,12 @@ void FileBrowserActivity::loop() {
} else {
std::string fullPath = basepath;
if (fullPath.back() != '/') fullPath += "/";
onSelectBook(fullPath + entry);
fullPath += entry;
ReturnHint hint;
hint.target = ReturnTo::FileBrowser;
hint.path = basepath;
hint.selectName = entry;
activityManager.replaceWithReader(std::move(fullPath), std::move(hint));
}
return;
}