From 476230606bda372d3aafdbd2b1d4dc473206ed3f Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Mon, 25 Dec 2023 13:12:14 +0100 Subject: [PATCH] Placeholder entries in es_systems.xml are now skipped by default when creating the system directories and systemsinfo.txt files Also added a CreatePlaceholderSystemDirectories option that can be manually set in es_settings.xml to still create placeholder directories --- es-app/src/SystemData.cpp | 13 +++++++++++++ es-core/src/Settings.cpp | 1 + 2 files changed, 14 insertions(+) diff --git a/es-app/src/SystemData.cpp b/es-app/src/SystemData.cpp index 2b52757b4..81c340a17 100644 --- a/es-app/src/SystemData.cpp +++ b/es-app/src/SystemData.cpp @@ -1134,6 +1134,19 @@ bool SystemData::createSystemDirectories() continue; } + if (commands.size() == 1 && + Utils::String::toLower(commands.front()).find("placeholder") != std::string::npos) { + if (Settings::getInstance()->getBool("CreatePlaceholderSystemDirectories")) { + LOG(LogInfo) << "System \"" << name + << "\" is a placeholder but creating directory anyway as " + "CreatePlaceholderSystemDirectories is set to true"; + } + else { + LOG(LogInfo) << "System \"" << name << "\" is a placeholder, skipping entry"; + continue; + } + } + themeFolder = system.child("theme").text().as_string(name.c_str()); // Check that the %ROMPATH% variable is actually used for the path element. diff --git a/es-core/src/Settings.cpp b/es-core/src/Settings.cpp index 09f415db4..43b6d180c 100644 --- a/es-core/src/Settings.cpp +++ b/es-core/src/Settings.cpp @@ -331,6 +331,7 @@ void Settings::setDefaults() mBoolMap["DebugSkipMissingThemeFiles"] = {false, false}; mBoolMap["DebugSkipMissingThemeFilesCustomCollections"] = {true, true}; mBoolMap["LegacyGamelistFileLocation"] = {false, false}; + mBoolMap["CreatePlaceholderSystemDirectories"] = {false, false}; mStringMap["OpenGLVersion"] = {"", ""}; #if !defined(__ANDROID__) mStringMap["ROMDirectory"] = {"", ""};