mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
Merge pull request #285 from Pecon/openWebBrowserLinux
Followup commit to switch to engine conventions
This commit is contained in:
commit
3108a08650
1 changed files with 16 additions and 15 deletions
|
|
@ -1,26 +1,27 @@
|
||||||
#include "platform/platform.h"
|
#include "platform/platform.h"
|
||||||
#include <string>
|
|
||||||
|
|
||||||
bool Platform::openWebBrowser( const char* webAddress )
|
bool Platform::openWebBrowser(const char* webAddress)
|
||||||
{
|
{
|
||||||
std::string startingURL(webAddress);
|
String startingURL(webAddress);
|
||||||
std::string filteredURL;
|
String filteredURL;
|
||||||
|
|
||||||
unsigned short length = startingURL.length();
|
U32 length = startingURL.length();
|
||||||
for(unsigned short i = 0; i < length; i++)
|
for(U32 i = 0; i < length; i++)
|
||||||
{
|
{
|
||||||
filteredURL = filteredURL + '\\' + startingURL.at(i);
|
filteredURL = filteredURL + '\\' + startingURL[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string runCommand = "URL=" + filteredURL + "; xdg-open $URL > /dev/null 2> /dev/null";
|
String runCommand = "URL=" + filteredURL + "; xdg-open $URL > /dev/null 2> /dev/null";
|
||||||
|
|
||||||
short statusCode;
|
S32 statusCode;
|
||||||
statusCode = system(runCommand.c_str());
|
statusCode = system(runCommand.c_str());
|
||||||
|
|
||||||
if(statusCode == 0)
|
if(statusCode == 0)
|
||||||
return true;
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TORQUE_DEDICATED
|
#ifdef TORQUE_DEDICATED
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue