Merge pull request #476 from tomaz82/hidden_files

Allow to show hidden files on Windows
This commit is contained in:
John Rassa 2018-08-29 22:12:30 -04:00 committed by GitHub
commit 564e9a48e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View file

@ -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;

View file

@ -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<SwitchComponent>(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