From e2bd5d05b193bb71c65e873849d81ee1e863e951 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 26 Jul 2020 13:58:49 +0200 Subject: [PATCH] Fixed an issue where hidden files would still show up if they had a gamelist.xml entry. --- INSTALL.md | 2 ++ es-app/src/Gamelist.cpp | 7 +++++++ es-app/src/SystemData.cpp | 4 ++-- es-app/src/emulationstation.6.gz | Bin 1041 -> 1065 bytes es-app/src/guis/GuiMenu.cpp | 2 +- es-app/src/main.cpp | 1 + 6 files changed, 13 insertions(+), 3 deletions(-) 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 afa29997f780b3ddafae987925ccb49dce670a72..653c0d1a3d91a6c24c3fb713f3ef4a5e41f5a650 100644 GIT binary patch delta 554 zcmV+_0@eMI2&o7MABzYG?QR{h2m1kkqHv#vl_(0X($L%bm{AO!^a$wtuVulFJ+&_k zL;KR8cbXcqod}CfKKQ6!FHUWgPD3P;&tRg}2L}{|*C#P_oTYw~sOGA@v?d3(ddI%I z0Gk`m&)QP(tlg5q${@GEAJGFbkzKZMFI1uTydd>IkKa)1f)B`1D+{7zuIo%!D7^4I ze2+_~kk|^@1w{#*bCpGo7dB&J@lE}vx7xqA#;(zEk(D`$x#aZf|m@ZmezoizXBG2Xu|i8+v*mdo|XA9q?5(5lApLgbForpb84c0!x8qR=d+;gj$ky7iMu&A*Sk z{1NJRQM_xR?bCnQ;O#qBg|HNgpALug{|W$YyWs>(Q3~Y5QIjh0GMA^om9Dw3Tf=bI z;J_H%e!5$KG*mcTW26Ffebzn1?6@`P7`Ho}x8v=%SWR!)o24I~q^)Z-V7Q8u6Zjk8 zm~SbLHe-HYj_)^j%XKiu^$fkS)V2~mnCbHGmR3z)8?hA%DSY((F$nzbT?r1KbzQeg zxC8WGWf<5K>dZKLP28cvlJzg2oKA7f5;V*_2jr-g1yL&3btV*EcpkmSg;Pi@rR;*D1kk4>g@yluw@dGT2TQg$ucu3U=rg%z2aCi&<~3*S+S!B3Jx{NOc#X{+4Ru)}Oi|Ks9?tH0-Viv*I8A7|hu-{IMR-iSI}sYT!J>T9w2xyJt;<>ecc*{y8;Ks;P%qp zqM*Xz8X^^->$C15X2-2T$GF|;yd7`9#cFzs-Yos_ByC-z0mD_IoWS3I09Wvq;%GDG z_ucq@bGKXvV_dJ$8%u2~(Sw;T|88kj^tBONp^(By-yeg(@6MIr@LAV&tAsm1|5b*8 zJ)zEwqu0b8DlA$5^2z9Q$aycBPGLMtmc8H>DGr6sTigc6r-q)E9TU>igt<@fbLCuP mKMjXl;ZPdkgbpRA2aOyP4KE)!TnWQpf`0*bpOxy=2LJ#bLJm#< 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"