Portable way of opening URLs and directories (#156)

Replaced every instance of ShellExecute with wxLaunchDefaultBrowser
This commit is contained in:
bitscher 2022-09-03 13:32:31 -07:00 committed by GitHub
parent f3c70e69b4
commit 1a1de370e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 67 deletions

View file

@ -1,9 +1,5 @@
#include "gui/TitleManager.h"
#ifdef _WIN32
#include <shellapi.h>
#endif
#include "gui/helpers/wxCustomEvents.h"
#include "gui/helpers/wxCustomData.h"
#include "Cafe/TitleList/GameInfo.h"
@ -483,11 +479,7 @@ void TitleManager::OnSaveOpenDirectory(wxCommandEvent& event)
if (!fs::exists(target) || !fs::is_directory(target))
return;
#ifdef _WIN32
ShellExecuteW(GetHWND(), L"open", target.c_str(), nullptr, nullptr, SW_SHOWNORMAL);
#else
assert_dbg();
#endif
wxLaunchDefaultBrowser(fmt::format("file:{}", _utf8Wrapper(target)));
}
void TitleManager::OnSaveDelete(wxCommandEvent& event)