A fork of https://github.com/crosspoint-reader/crosspoint-reader
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: Show hidden directories in browser (#1288)

## Summary

* **What is the goal of this PR?** Add setting to display hidden files /
directories in filebrowser / web file browser
* **What changes are included?**

## Additional Context

-

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**< NO >**_

authored by

jpirnay and committed by
GitHub
f9286709 dc394803

+6 -2
+1
lib/I18n/translations/english.yaml
··· 115 115 STR_PARA_ALIGNMENT: "Reader Paragraph Alignment" 116 116 STR_HYPHENATION: "Hyphenation" 117 117 STR_TIME_TO_SLEEP: "Time to Sleep" 118 + STR_SHOW_HIDDEN_FILES: "Show Hidden Files" 118 119 STR_REFRESH_FREQ: "Refresh Frequency" 119 120 STR_CALIBRE_SETTINGS: "Calibre Settings" 120 121 STR_KOREADER_SYNC: "KOReader Sync"
+2
src/SettingsList.h
··· 78 78 SettingInfo::Enum(StrId::STR_TIME_TO_SLEEP, &CrossPointSettings::sleepTimeout, 79 79 {StrId::STR_MIN_1, StrId::STR_MIN_5, StrId::STR_MIN_10, StrId::STR_MIN_15, StrId::STR_MIN_30}, 80 80 "sleepTimeout", StrId::STR_CAT_SYSTEM), 81 + SettingInfo::Toggle(StrId::STR_SHOW_HIDDEN_FILES, &CrossPointSettings::showHiddenFiles, "showHiddenFiles", 82 + StrId::STR_CAT_SYSTEM), 81 83 82 84 // --- KOReader Sync (web-only, uses KOReaderCredentialStore) --- 83 85 SettingInfo::DynamicString(
+2 -1
src/activities/home/FileBrowserActivity.cpp
··· 9 9 #include <algorithm> 10 10 11 11 #include "../util/ConfirmationActivity.h" 12 + #include "CrossPointSettings.h" 12 13 #include "MappedInputManager.h" 13 14 #include "components/UITheme.h" 14 15 #include "fontIds.h" ··· 83 84 char name[500]; 84 85 for (auto file = root.openNextFile(); file; file = root.openNextFile()) { 85 86 file.getName(name, sizeof(name)); 86 - if (name[0] == '.' || strcmp(name, "System Volume Information") == 0) { 87 + if ((!SETTINGS.showHiddenFiles && name[0] == '.') || strcmp(name, "System Volume Information") == 0) { 87 88 file.close(); 88 89 continue; 89 90 }
+1 -1
src/network/CrossPointWebServer.cpp
··· 354 354 auto fileName = String(name); 355 355 356 356 // Skip hidden items (starting with ".") 357 - bool shouldHide = fileName.startsWith("."); 357 + bool shouldHide = !SETTINGS.showHiddenFiles && fileName.startsWith("."); 358 358 359 359 // Check against explicitly hidden items list 360 360 if (!shouldHide) {