diff options
| author | 2023-11-19 12:24:43 -0500 | |
|---|---|---|
| committer | 2023-11-21 01:58:13 -0500 | |
| commit | f3fe362c93efff124c4ef0a005cdcd1cd635f8f5 (patch) | |
| tree | 15f8bc2c39e262ced734497b54d349b5efaf60cb /src/frontend_common/config.cpp | |
| parent | frontend_common: Disable UTF-8 BOM in config (diff) | |
| download | yuzu-f3fe362c93efff124c4ef0a005cdcd1cd635f8f5.tar.gz yuzu-f3fe362c93efff124c4ef0a005cdcd1cd635f8f5.tar.xz yuzu-f3fe362c93efff124c4ef0a005cdcd1cd635f8f5.zip | |
frontend_common: Add special config case for unmapped windows network drives
Normally we save paths with '/' as the delimiter for each segment but when you manually select a network drive instead of using a mapped location, this would break. This ensures that if the read filesystem location starts with '//', we keep that pattern.
Diffstat (limited to 'src/frontend_common/config.cpp')
| -rw-r--r-- | src/frontend_common/config.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/frontend_common/config.cpp b/src/frontend_common/config.cpp index 8eb62e8ef..b3f4a54a4 100644 --- a/src/frontend_common/config.cpp +++ b/src/frontend_common/config.cpp | |||
| @@ -856,7 +856,15 @@ std::string Config::AdjustKey(const std::string& key) { | |||
| 856 | std::string Config::AdjustOutputString(const std::string& string) { | 856 | std::string Config::AdjustOutputString(const std::string& string) { |
| 857 | std::string adjusted_string(string); | 857 | std::string adjusted_string(string); |
| 858 | boost::replace_all(adjusted_string, "\\", "/"); | 858 | boost::replace_all(adjusted_string, "\\", "/"); |
| 859 | boost::replace_all(adjusted_string, "//", "/"); | 859 | |
| 860 | // Windows requires that two forward slashes are used at the start of a path for unmapped | ||
| 861 | // network drives so we have to watch for that here | ||
| 862 | if (string.substr(0, 2) == "//") { | ||
| 863 | boost::replace_all(adjusted_string, "//", "/"); | ||
| 864 | adjusted_string.insert(0, "/"); | ||
| 865 | } else { | ||
| 866 | boost::replace_all(adjusted_string, "//", "/"); | ||
| 867 | } | ||
| 860 | 868 | ||
| 861 | // Needed for backwards compatibility with QSettings deserialization | 869 | // Needed for backwards compatibility with QSettings deserialization |
| 862 | for (const auto& special_character : special_characters) { | 870 | for (const auto& special_character : special_characters) { |