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