From b21dbc4adab25e9f120d3eb8b28c0d11b6095812 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Mon, 27 Jul 2020 13:06:46 +0200 Subject: [PATCH] (Windows) Improved handling of hidden files and folders. --- es-app/src/FileData.cpp | 4 ---- es-app/src/SystemData.cpp | 8 ++++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/es-app/src/FileData.cpp b/es-app/src/FileData.cpp index 788c13e48..33d2b728e 100644 --- a/es-app/src/FileData.cpp +++ b/es-app/src/FileData.cpp @@ -51,16 +51,12 @@ FileData::FileData( MameNames::getInstance()->getCleanName(getCleanName())); } else { - #ifdef __unix__ if (metadata.getType() == FOLDER_METADATA && Utils::FileSystem::isHidden(mPath)) { metadata.set("name", Utils::FileSystem::getFileName(mPath)); } else { metadata.set("name", getDisplayName()); } - #else - metadata.set("name", getDisplayName()); - #endif } } mSystemName = system->getName(); diff --git a/es-app/src/SystemData.cpp b/es-app/src/SystemData.cpp index f472c6412..1a0a39cbb 100644 --- a/es-app/src/SystemData.cpp +++ b/es-app/src/SystemData.cpp @@ -307,6 +307,14 @@ bool SystemData::loadConfig() // Convert path to generic directory seperators. path = Utils::FileSystem::getGenericPath(path); + #ifdef _WIN64 + if (!Settings::getInstance()->getBool("ShowHiddenFiles") && + Utils::FileSystem::isHidden(path)) { + LOG(LogWarning) << "Skipping hidden ROM folder " << path; + continue; + } + #endif + // Create the system runtime environment data. SystemEnvironmentData* envData = new SystemEnvironmentData; envData->mStartPath = path;