From efa2c1c500c770af134d3615dafce5d9eb3894db Mon Sep 17 00:00:00 2001 From: The Dax Date: Sun, 15 Sep 2013 00:08:53 -0400 Subject: [PATCH] Use consistent directory slashes. We'll just replace all backslashes with forward slashes, eliminating the chance of duplicat recents. Fixes #3352. --- UI/MainScreen.cpp | 14 ++++++++++++-- Windows/WndMainWindow.cpp | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 833a0ba74e..e31f399114 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -589,13 +589,23 @@ UI::EventReturn MainScreen::OnLoadFile(UI::EventParams &e) { } UI::EventReturn MainScreen::OnGameSelected(UI::EventParams &e) { - screenManager()->push(new GameScreen(e.s)); + #ifdef _WIN32 + std::string path = ReplaceAll(e.s, "//", "/"); +#else + std::string path = e.s; +#endif + screenManager()->push(new GameScreen(path)); return UI::EVENT_DONE; } UI::EventReturn MainScreen::OnGameSelectedInstant(UI::EventParams &e) { + #ifdef _WIN32 + std::string path = ReplaceAll(e.s, "//", "/"); +#else + std::string path = e.s; +#endif // Go directly into the game. - screenManager()->switchScreen(new EmuScreen(e.s)); + screenManager()->switchScreen(new EmuScreen(path)); return UI::EVENT_DONE; } diff --git a/Windows/WndMainWindow.cpp b/Windows/WndMainWindow.cpp index 04af3825ae..cfe4693ee3 100644 --- a/Windows/WndMainWindow.cpp +++ b/Windows/WndMainWindow.cpp @@ -794,6 +794,7 @@ namespace MainWindow _splitpath(fullpath.c_str(), drive, dir, fname, ext); std::string executable = std::string(drive) + std::string(dir) + std::string(fname) + std::string(ext); + executable = ReplaceAll(executable, "\\", "/"); NativeMessageReceived("boot", executable.c_str()); } else {