From ed121ee6792f5d9ca74447d6b36b193f187b7945 Mon Sep 17 00:00:00 2001 From: MayImilae Date: Tue, 24 Jan 2023 02:30:47 -0800 Subject: [PATCH] Removed filepath from State Save/Load OSD messages Though less important compared to #11470, save states also show the full path in the OSD message and could potentially dox a streamer who is playing in Dolphin. This is a simple fix - it removes the path from the message and only displays the file name. --- Source/Core/Core/State.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/State.cpp b/Source/Core/Core/State.cpp index d0cb1d0d3b..405af72f4a 100644 --- a/Source/Core/Core/State.cpp +++ b/Source/Core/Core/State.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -458,7 +459,8 @@ static void CompressAndDumpState(CompressAndDumpState_args& save_args) File::Rename(temp_filename, filename); } - Core::DisplayMessage(fmt::format("Saved State to {}", filename), 2000); + std::filesystem::path tempfilename(filename); + Core::DisplayMessage(fmt::format("Saved State to {}", tempfilename.filename().string()), 2000); Host_UpdateMainFrame(); } @@ -688,7 +690,9 @@ void LoadAs(const std::string& filename) { if (loadedSuccessfully) { - Core::DisplayMessage(fmt::format("Loaded state from {}", filename), 2000); + std::filesystem::path tempfilename(filename); + Core::DisplayMessage( + fmt::format("Loaded State from {}", tempfilename.filename().string()), 2000); if (File::Exists(filename + ".dtm")) Movie::LoadInput(filename + ".dtm"); else if (!Movie::IsJustStartingRecordingInputFromSaveState() &&