(Windows) Improved handling of hidden files and folders.

This commit is contained in:
Leon Styhre 2020-07-27 13:06:46 +02:00
parent bad9e772e9
commit b21dbc4ada
2 changed files with 8 additions and 4 deletions

View file

@ -51,16 +51,12 @@ FileData::FileData(
MameNames::getInstance()->getCleanName(getCleanName())); MameNames::getInstance()->getCleanName(getCleanName()));
} }
else { else {
#ifdef __unix__
if (metadata.getType() == FOLDER_METADATA && Utils::FileSystem::isHidden(mPath)) { if (metadata.getType() == FOLDER_METADATA && Utils::FileSystem::isHidden(mPath)) {
metadata.set("name", Utils::FileSystem::getFileName(mPath)); metadata.set("name", Utils::FileSystem::getFileName(mPath));
} }
else { else {
metadata.set("name", getDisplayName()); metadata.set("name", getDisplayName());
} }
#else
metadata.set("name", getDisplayName());
#endif
} }
} }
mSystemName = system->getName(); mSystemName = system->getName();

View file

@ -307,6 +307,14 @@ bool SystemData::loadConfig()
// Convert path to generic directory seperators. // Convert path to generic directory seperators.
path = Utils::FileSystem::getGenericPath(path); 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. // Create the system runtime environment data.
SystemEnvironmentData* envData = new SystemEnvironmentData; SystemEnvironmentData* envData = new SystemEnvironmentData;
envData->mStartPath = path; envData->mStartPath = path;