From 08a55d19d5ddf9c35ee9036db545b27ad87a615b Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 9 Oct 2021 15:56:39 -0700 Subject: [PATCH] macOS: Allow opening game folder. --- SDL/SDLMain.cpp | 5 ++++- UI/GameScreen.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp index f0f74f979a..e3db0bb005 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp @@ -190,12 +190,15 @@ void System_AskForPermission(SystemPermission permission) {} PermissionStatus System_GetPermissionStatus(SystemPermission permission) { return PERMISSION_STATUS_GRANTED; } void OpenDirectory(const char *path) { -#if defined(_WIN32) +#if PPSSPP_PLATFORM(WINDOWS) PIDLIST_ABSOLUTE pidl = ILCreateFromPath(ConvertUTF8ToWString(ReplaceAll(path, "/", "\\")).c_str()); if (pidl) { SHOpenFolderAndSelectItems(pidl, 0, NULL, 0); ILFree(pidl); } +#elif PPSSPP_PLATFORM(MAC) + std::string command = std::string("open ") + path; + system(command.c_str()); #endif } diff --git a/UI/GameScreen.cpp b/UI/GameScreen.cpp index 7a885187f5..2749fa98b3 100644 --- a/UI/GameScreen.cpp +++ b/UI/GameScreen.cpp @@ -168,7 +168,7 @@ void GameScreen::CreateViews() { if (isRecentGame(gamePath_)) { rightColumnItems->Add(AddOtherChoice(new Choice(ga->T("Remove From Recent"))))->OnClick.Handle(this, &GameScreen::OnRemoveFromRecent); } -#if (defined(USING_QT_UI) || PPSSPP_PLATFORM(WINDOWS)) && !PPSSPP_PLATFORM(UWP) +#if (defined(USING_QT_UI) || PPSSPP_PLATFORM(WINDOWS) || PPSSPP_PLATFORM(MAC)) && !PPSSPP_PLATFORM(UWP) rightColumnItems->Add(AddOtherChoice(new Choice(ga->T("Show In Folder"))))->OnClick.Handle(this, &GameScreen::OnShowInFolder); #endif if (g_Config.bEnableCheats) {