diff --git a/es-app/src/CollectionSystemsManager.cpp b/es-app/src/CollectionSystemsManager.cpp index 63109ec72..9c835ee64 100644 --- a/es-app/src/CollectionSystemsManager.cpp +++ b/es-app/src/CollectionSystemsManager.cpp @@ -226,8 +226,8 @@ void CollectionSystemsManager::loadCollectionSystems() void CollectionSystemsManager::loadEnabledListFromSettings() { // We parse the auto collection settings list. - std::vector autoSelected = Utils::String::commaStringToVector( - Settings::getInstance()->getString("CollectionSystemsAuto"), true); + std::vector autoSelected = Utils::String::delimitedStringToVector( + Settings::getInstance()->getString("CollectionSystemsAuto"), ",", true); // Iterate the map. for (std::map::iterator @@ -241,8 +241,8 @@ void CollectionSystemsManager::loadEnabledListFromSettings() mHasEnabledCustomCollection = false; // Parse the custom collection settings list. - std::vector customSelected = Utils::String::commaStringToVector( - Settings::getInstance()->getString("CollectionSystemsCustom"), true); + std::vector customSelected = Utils::String::delimitedStringToVector( + Settings::getInstance()->getString("CollectionSystemsCustom"), ",", true); // Iterate the map. for (std::map::iterator diff --git a/es-app/src/guis/GuiCollectionSystemsOptions.cpp b/es-app/src/guis/GuiCollectionSystemsOptions.cpp index b120ff6cc..ce45522e4 100644 --- a/es-app/src/guis/GuiCollectionSystemsOptions.cpp +++ b/es-app/src/guis/GuiCollectionSystemsOptions.cpp @@ -51,8 +51,8 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions( it->second.isEnabled); addWithLabel("AUTOMATIC GAME COLLECTIONS", collection_systems_auto); addSaveFunc([this, autoSystems] { - std::string autoSystemsSelected = - Utils::String::vectorToCommaString(collection_systems_auto->getSelectedObjects(), true); + std::string autoSystemsSelected = Utils::String::vectorToDelimitedString( + collection_systems_auto->getSelectedObjects(), ",", true); std::string autoSystemsConfig = Settings::getInstance()->getString("CollectionSystemsAuto"); if (autoSystemsSelected != autoSystemsConfig) { if (CollectionSystemsManager::get()->isEditing()) @@ -100,8 +100,8 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions( addWithLabel("CUSTOM GAME COLLECTIONS", collection_systems_custom); addSaveFunc([this, customSystems] { if (!mDeletedCustomCollection) { - std::string customSystemsSelected = Utils::String::vectorToCommaString( - collection_systems_custom->getSelectedObjects(), true); + std::string customSystemsSelected = Utils::String::vectorToDelimitedString( + collection_systems_custom->getSelectedObjects(), ",", true); std::string customSystemsConfig = Settings::getInstance()-> getString("CollectionSystemsCustom"); if (customSystemsSelected != customSystemsConfig) { diff --git a/es-core/src/utils/StringUtil.cpp b/es-core/src/utils/StringUtil.cpp index 6145451fe..31214c5df 100644 --- a/es-core/src/utils/StringUtil.cpp +++ b/es-core/src/utils/StringUtil.cpp @@ -522,13 +522,8 @@ namespace Utils return vector; } - std::vector commaStringToVector(const std::string& _string, - bool sort, bool caseInsensitive) - { - return delimitedStringToVector(_string, ",", sort, caseInsensitive); - } - - std::string vectorToCommaString(std::vector _vector, bool caseInsensitive) + std::string vectorToDelimitedString(std::vector _vector, + const std::string& _delimiter, bool caseInsensitive) { std::string string; @@ -541,7 +536,7 @@ namespace Utils for (std::vector::const_iterator it = _vector.cbegin(); it != _vector.cend(); it++) - string += (string.length() ? "," : "") + (*it); + string += (string.length() ? _delimiter : "") + (*it); return string; } diff --git a/es-core/src/utils/StringUtil.h b/es-core/src/utils/StringUtil.h index fd8c16b89..a8a9098e8 100644 --- a/es-core/src/utils/StringUtil.h +++ b/es-core/src/utils/StringUtil.h @@ -36,10 +36,8 @@ namespace Utils std::string removeParenthesis(const std::string& _string); std::vector delimitedStringToVector(const std::string& _string, const std::string& _delimiter, bool sort = false, bool caseInsensitive = false); - std::vector commaStringToVector(const std::string& _string, - bool sort = false, bool caseInsensitive = false); - std::string vectorToCommaString(std::vector _vector, - bool caseInsensitive = false); + std::string vectorToDelimitedString(std::vector _vector, + const std::string& _delimiter, bool caseInsensitive = false); std::string format(const char* _string, ...); std::string scramble(const std::string& _input, const std::string& key); }