From 2f0e6389da2a162650762eb134e2af247a920776 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sat, 29 Jan 2022 14:09:13 +0100 Subject: [PATCH] Use u8string in FileDialogDesc --- src/openrct2-ui/windows/LoadSave.cpp | 2 +- src/openrct2/ui/UiContext.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index 895bb21750..fc988b33a7 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -418,7 +418,7 @@ static bool Browse(bool isSave, char* path, size_t pathSize) desc.InitialDirectory = _directory; desc.Type = isSave ? OpenRCT2::Ui::FileDialogType::Save : OpenRCT2::Ui::FileDialogType::Open; - desc.DefaultFilename = isSave ? path : ""; + desc.DefaultFilename = isSave ? path : u8string(); // Add 'all files' filter. If the number of filters is increased, this code will need to be adjusted. desc.Filters.emplace_back(language_get_string(STR_ALL_FILES), "*"); diff --git a/src/openrct2/ui/UiContext.h b/src/openrct2/ui/UiContext.h index 33d8f25b0a..3660fc42f4 100644 --- a/src/openrct2/ui/UiContext.h +++ b/src/openrct2/ui/UiContext.h @@ -75,8 +75,8 @@ namespace OpenRCT2 { struct Filter { - std::string Name; // E.g. "Image Files" - std::string Pattern; // E.g. "*.png;*.jpg;*.gif" + u8string Name; // E.g. "Image Files" + u8string Pattern; // E.g. "*.png;*.jpg;*.gif" Filter(u8string_view name, u8string_view pattern) : Name(name) @@ -86,9 +86,9 @@ namespace OpenRCT2 }; FileDialogType Type = FileDialogType::Open; - std::string Title; - std::string InitialDirectory; - std::string DefaultFilename; + u8string Title; + u8string InitialDirectory; + u8string DefaultFilename; std::vector Filters; };