refactor: rename MyLibrary to FileBrowser (#1260)
Some checks failed
CI (build) / clang-format (push) Has been cancelled
CI (build) / cppcheck (push) Has been cancelled
CI (build) / build (push) Has been cancelled
CI (build) / Test Status (push) Has been cancelled

## Summary

* Renames MyLibrary component to FileBrowser, as it better reflects what
it is, in my opinion

## Additional Context

* Frees the Library name for possible future library component that can
cache metadata, provide other ways of browsing than filesystem
structure, etc
---

### AI Usage

Did you use AI tools to help write this code? _**< YES >**_
This commit is contained in:
Arthur Tazhitdinov
2026-03-02 13:00:53 +03:00
committed by GitHub
parent 7dc518624c
commit f0a549b680
11 changed files with 33 additions and 33 deletions

View File

@@ -20,7 +20,7 @@
#include "util/StringUtils.h"
int HomeActivity::getMenuItemCount() const {
int count = 4; // My Library, Recents, File transfer, Settings
int count = 4; // File Browser, Recents, File transfer, Settings
if (!recentBooks.empty()) {
count += recentBooks.size();
}
@@ -189,7 +189,7 @@ void HomeActivity::loop() {
// Calculate dynamic indices based on which options are available
int idx = 0;
int menuSelectedIndex = selectorIndex - static_cast<int>(recentBooks.size());
const int myLibraryIdx = idx++;
const int fileBrowserIdx = idx++;
const int recentsIdx = idx++;
const int opdsLibraryIdx = hasOpdsUrl ? idx++ : -1;
const int fileTransferIdx = idx++;
@@ -197,8 +197,8 @@ void HomeActivity::loop() {
if (selectorIndex < recentBooks.size()) {
onSelectBook(recentBooks[selectorIndex].path);
} else if (menuSelectedIndex == myLibraryIdx) {
onMyLibraryOpen();
} else if (menuSelectedIndex == fileBrowserIdx) {
onFileBrowserOpen();
} else if (menuSelectedIndex == recentsIdx) {
onRecentsOpen();
} else if (menuSelectedIndex == opdsLibraryIdx) {
@@ -231,7 +231,7 @@ void HomeActivity::render(RenderLock&&) {
std::vector<UIIcon> menuIcons = {Folder, Recent, Transfer, Settings};
if (hasOpdsUrl) {
// Insert OPDS Browser after My Library
// Insert OPDS Browser after File Browser
menuItems.insert(menuItems.begin() + 2, tr(STR_OPDS_BROWSER));
menuIcons.insert(menuIcons.begin() + 2, Library);
}
@@ -261,7 +261,7 @@ void HomeActivity::render(RenderLock&&) {
void HomeActivity::onSelectBook(const std::string& path) { activityManager.goToReader(path); }
void HomeActivity::onMyLibraryOpen() { activityManager.goToMyLibrary(); }
void HomeActivity::onFileBrowserOpen() { activityManager.goToFileBrowser(); }
void HomeActivity::onRecentsOpen() { activityManager.goToRecentBooks(); }