mirror of
https://github.com/edubart/otclient.git
synced 2025-04-30 01:29:21 +02:00
Fix opening URLs on macOS (#1159)
This commit is contained in:
parent
f173b03dbd
commit
302748b2f3
@ -119,9 +119,14 @@ ticks_t Platform::getFileModificationTime(std::string file)
|
|||||||
|
|
||||||
void Platform::openUrl(std::string url)
|
void Platform::openUrl(std::string url)
|
||||||
{
|
{
|
||||||
if(url.find("http://") == std::string::npos)
|
if(url.find("http://") == std::string::npos && url.find("https://") == std::string::npos)
|
||||||
url.insert(0, "http://");
|
url.insert(0, "http://");
|
||||||
|
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
system(stdext::format("open %s", url).c_str());
|
||||||
|
#else
|
||||||
system(stdext::format("xdg-open %s", url).c_str());
|
system(stdext::format("xdg-open %s", url).c_str());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Platform::getCPUName()
|
std::string Platform::getCPUName()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user