Fix opening controller config when there is no profile directory
https://bugs.dolphin-emu.org/issues/11771
This commit is contained in:
parent
b11f630565
commit
63bb646721
|
@ -96,19 +96,23 @@ std::vector<std::string> DoFileSearch(const std::vector<std::string>& directorie
|
|||
result.emplace_back(path.u8string());
|
||||
};
|
||||
for (const auto& directory : directories)
|
||||
{
|
||||
const fs::path directory_path = fs::u8path(directory);
|
||||
if (fs::is_directory(directory_path)) // Can't create iterators for non-existant directories
|
||||
{
|
||||
if (recursive)
|
||||
{
|
||||
// TODO use fs::directory_options::follow_directory_symlink ?
|
||||
for (auto& entry : fs::recursive_directory_iterator(fs::u8path(directory)))
|
||||
for (auto& entry : fs::recursive_directory_iterator(std::move(directory_path)))
|
||||
add_filtered(entry);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (auto& entry : fs::directory_iterator(fs::u8path(directory)))
|
||||
for (auto& entry : fs::directory_iterator(std::move(directory_path)))
|
||||
add_filtered(entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Remove duplicates (occurring because caller gave e.g. duplicate or overlapping directories -
|
||||
// not because std::filesystem returns duplicates). Also note that this pathname-based uniqueness
|
||||
|
|
Loading…
Reference in New Issue