diff --git a/INSTALL.md b/INSTALL.md index 63ac42c6d..6facac11c 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -559,6 +559,7 @@ You can use `--help` or `-h` to view a list of command line options, as shown he --resolution [width] [height] Try to force a particular resolution --gamelist-only Skip automatic game ROM search, only read from gamelist.xml --ignore-gamelist Ignore the gamelist files (useful for troubleshooting) +--show-hidden-files Show hidden files and folders --draw-framerate Display the framerate --no-exit Don't show the exit option in the menu --no-splash Don't show the splash screen @@ -583,6 +584,7 @@ You can use `--help` or `-h` to view a list of command line options, as shown he --resolution [width] [height] Try to force a particular resolution --gamelist-only Skip automatic game ROM search, only read from gamelist.xml --ignore-gamelist Ignore the gamelist files (useful for troubleshooting) +--show-hidden-files Show hidden files and folders --draw-framerate Display the framerate --no-exit Don't show the exit option in the menu --no-splash Don't show the splash screen diff --git a/es-app/src/Gamelist.cpp b/es-app/src/Gamelist.cpp index 9d561d114..680d9f5e1 100644 --- a/es-app/src/Gamelist.cpp +++ b/es-app/src/Gamelist.cpp @@ -114,6 +114,7 @@ void parseGamelist(SystemData* system) } std::string relativeTo = system->getStartPath(); + bool showHiddenFiles = Settings::getInstance()->getBool("ShowHiddenFiles"); const char* tagList[2] = { "game", "folder" }; FileType typeList[2] = { GAME, FOLDER }; @@ -131,6 +132,12 @@ void parseGamelist(SystemData* system) continue; } + // Skip hidden files and folders. + if (!showHiddenFiles && Utils::FileSystem::isHidden(path)) { + LOG(LogDebug) << "Gamelist::parseGamelist(): Skipping hidden file " << path; + continue; + } + FileData* file = findOrCreateFile(system, path, type); if (!file) { LOG(LogError) << "Error finding/creating FileData for \"" << diff --git a/es-app/src/SystemData.cpp b/es-app/src/SystemData.cpp index b30f4dee3..8ad83df51 100644 --- a/es-app/src/SystemData.cpp +++ b/es-app/src/SystemData.cpp @@ -120,7 +120,7 @@ bool SystemData::populateFolder(FileData* folder) std::string filePath; std::string extension; bool isGame; - bool showHidden = Settings::getInstance()->getBool("ShowHiddenFiles"); + bool showHiddenFiles = Settings::getInstance()->getBool("ShowHiddenFiles"); Utils::FileSystem::stringList dirContent = Utils::FileSystem::getDirContent(folderPath); // If system directory exists but contains no games, return as error. @@ -132,7 +132,7 @@ bool SystemData::populateFolder(FileData* folder) filePath = *it; // Skip hidden files and folders. - if (!showHidden && Utils::FileSystem::isHidden(filePath)) + if (!showHiddenFiles && Utils::FileSystem::isHidden(filePath)) continue; // This is a little complicated because we allow a list diff --git a/es-app/src/emulationstation.6.gz b/es-app/src/emulationstation.6.gz index afa29997f..653c0d1a3 100644 Binary files a/es-app/src/emulationstation.6.gz and b/es-app/src/emulationstation.6.gz differ diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index 736d6bd53..448c2041a 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -640,7 +640,7 @@ void GuiMenu::openOtherSettings() // Hidden files. auto hidden_files = std::make_shared(mWindow); hidden_files->setState(Settings::getInstance()->getBool("ShowHiddenFiles")); - s->addWithLabel("SHOW HIDDEN FILES", hidden_files); + s->addWithLabel("SHOW HIDDEN FILES AND FOLDERS (REQUIRES RESTART)", hidden_files); s->addSaveFunc([hidden_files] { Settings::getInstance()->setBool("ShowHiddenFiles", hidden_files->getState()); }); diff --git a/es-app/src/main.cpp b/es-app/src/main.cpp index 3676c31c0..688100832 100644 --- a/es-app/src/main.cpp +++ b/es-app/src/main.cpp @@ -285,6 +285,7 @@ bool parseArgs(int argc, char* argv[]) " --resolution [width] [height] Try to force a particular resolution\n" " --gamelist-only Skip automatic game ROM search, only read from gamelist.xml\n" " --ignore-gamelist Ignore the gamelist files (useful for troubleshooting)\n" +" --show-hidden-files Show hidden files and folders\n" " --draw-framerate Display the framerate\n" " --no-exit Don't show the exit option in the menu\n" " --no-splash Don't show the splash screen\n"