From 747e400593a7df86e9422edcc500012603054058 Mon Sep 17 00:00:00 2001 From: Tomas Jakobsson Date: Mon, 20 Aug 2018 13:54:58 +0200 Subject: [PATCH] Allow to show hidden files on Windows Skip hidden files earlier --- es-app/src/SystemData.cpp | 8 ++++---- es-app/src/guis/GuiMenu.cpp | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/es-app/src/SystemData.cpp b/es-app/src/SystemData.cpp index 30790798e..04fa62838 100644 --- a/es-app/src/SystemData.cpp +++ b/es-app/src/SystemData.cpp @@ -97,6 +97,10 @@ void SystemData::populateFolder(FileData* folder) { filePath = *it; + // skip hidden files and folders + if(!showHidden && Utils::FileSystem::isHidden(filePath)) + continue; + //this is a little complicated because we allow a list of extensions to be defined (delimited with a space) //we first get the extension of the file itself: extension = Utils::FileSystem::getExtension(filePath); @@ -107,10 +111,6 @@ void SystemData::populateFolder(FileData* folder) isGame = false; if(std::find(mEnvData->mSearchExtensions.cbegin(), mEnvData->mSearchExtensions.cend(), extension) != mEnvData->mSearchExtensions.cend()) { - // skip hidden files - if(!showHidden && Utils::FileSystem::isHidden(filePath)) - continue; - FileData* newGame = new FileData(GAME, filePath, mEnvData, this); folder->addChild(newGame); isGame = true; diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index 53512c89b..37d4de083 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -363,13 +363,11 @@ void GuiMenu::openOtherSettings() s->addWithLabel("PARSE GAMESLISTS ONLY", parse_gamelists); s->addSaveFunc([parse_gamelists] { Settings::getInstance()->setBool("ParseGamelistOnly", parse_gamelists->getState()); }); -#ifndef WIN32 // hidden files auto hidden_files = std::make_shared(mWindow); hidden_files->setState(Settings::getInstance()->getBool("ShowHiddenFiles")); s->addWithLabel("SHOW HIDDEN FILES", hidden_files); s->addSaveFunc([hidden_files] { Settings::getInstance()->setBool("ShowHiddenFiles", hidden_files->getState()); }); -#endif #ifdef _RPI_ // Video Player - VideoOmxPlayer