[Base] LaunchWebBrowser now takes a string view.
This commit is contained in:
parent
e84ef132ae
commit
a12f775c23
|
@ -17,7 +17,7 @@
|
|||
|
||||
namespace xe {
|
||||
|
||||
void LaunchWebBrowser(const std::string& url);
|
||||
void LaunchWebBrowser(const std::string_view url);
|
||||
void LaunchFileExplorer(const std::filesystem::path& path);
|
||||
|
||||
enum class SimpleMessageBoxType {
|
||||
|
|
|
@ -18,8 +18,9 @@
|
|||
|
||||
namespace xe {
|
||||
|
||||
void LaunchWebBrowser(const std::string& url) {
|
||||
auto cmd = "xdg-open " + url;
|
||||
void LaunchWebBrowser(const std::string_view url) {
|
||||
auto cmd = std::string("xdg-open ");
|
||||
cmd.append(url);
|
||||
system(cmd.c_str());
|
||||
}
|
||||
|
||||
|
|
|
@ -13,9 +13,9 @@
|
|||
|
||||
namespace xe {
|
||||
|
||||
void LaunchWebBrowser(const std::string& url) {
|
||||
auto temp = xe::to_utf16(url);
|
||||
ShellExecuteW(nullptr, L"open", reinterpret_cast<LPCWSTR>(temp.c_str()),
|
||||
void LaunchWebBrowser(const std::string_view url) {
|
||||
auto wide_url = xe::to_utf16(url);
|
||||
ShellExecuteW(nullptr, L"open", reinterpret_cast<LPCWSTR>(wide_url.c_str()),
|
||||
nullptr, nullptr, SW_SHOWNORMAL);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue