Allow to show hidden files on Windows

Skip hidden files earlier
This commit is contained in:
Tomas Jakobsson 2018-08-20 13:54:58 +02:00
parent dc541e5e25
commit 747e400593
2 changed files with 4 additions and 6 deletions

View file

@ -97,6 +97,10 @@ void SystemData::populateFolder(FileData* folder)
{ {
filePath = *it; 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) //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: //we first get the extension of the file itself:
extension = Utils::FileSystem::getExtension(filePath); extension = Utils::FileSystem::getExtension(filePath);
@ -107,10 +111,6 @@ void SystemData::populateFolder(FileData* folder)
isGame = false; isGame = false;
if(std::find(mEnvData->mSearchExtensions.cbegin(), mEnvData->mSearchExtensions.cend(), extension) != mEnvData->mSearchExtensions.cend()) 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); FileData* newGame = new FileData(GAME, filePath, mEnvData, this);
folder->addChild(newGame); folder->addChild(newGame);
isGame = true; isGame = true;

View file

@ -363,13 +363,11 @@ void GuiMenu::openOtherSettings()
s->addWithLabel("PARSE GAMESLISTS ONLY", parse_gamelists); s->addWithLabel("PARSE GAMESLISTS ONLY", parse_gamelists);
s->addSaveFunc([parse_gamelists] { Settings::getInstance()->setBool("ParseGamelistOnly", parse_gamelists->getState()); }); s->addSaveFunc([parse_gamelists] { Settings::getInstance()->setBool("ParseGamelistOnly", parse_gamelists->getState()); });
#ifndef WIN32
// hidden files // hidden files
auto hidden_files = std::make_shared<SwitchComponent>(mWindow); auto hidden_files = std::make_shared<SwitchComponent>(mWindow);
hidden_files->setState(Settings::getInstance()->getBool("ShowHiddenFiles")); hidden_files->setState(Settings::getInstance()->getBool("ShowHiddenFiles"));
s->addWithLabel("SHOW HIDDEN FILES", hidden_files); s->addWithLabel("SHOW HIDDEN FILES", hidden_files);
s->addSaveFunc([hidden_files] { Settings::getInstance()->setBool("ShowHiddenFiles", hidden_files->getState()); }); s->addSaveFunc([hidden_files] { Settings::getInstance()->setBool("ShowHiddenFiles", hidden_files->getState()); });
#endif
#ifdef _RPI_ #ifdef _RPI_
// Video Player - VideoOmxPlayer // Video Player - VideoOmxPlayer