Parcourir la source

Merge pull request #285 from Pecon/openWebBrowserLinux

Followup commit to switch to engine conventions
Brian Roberts il y a 5 ans
Parent
commit
3108a08650
1 fichiers modifiés avec 16 ajouts et 15 suppressions
  1. 16 15
      Engine/source/platformX86UNIX/x86UNIXPlatform.cpp

+ 16 - 15
Engine/source/platformX86UNIX/x86UNIXPlatform.cpp

@@ -1,26 +1,27 @@
 #include "platform/platform.h"
-#include <string>
 
-bool Platform::openWebBrowser( const char* webAddress )
+bool Platform::openWebBrowser(const char* webAddress)
 {
-    std::string startingURL(webAddress);
-    std::string filteredURL;
+   String startingURL(webAddress);
+   String filteredURL;
 
-    unsigned short length = startingURL.length();
-    for(unsigned short i = 0; i < length; i++)
-    {
-        filteredURL = filteredURL + '\\' + startingURL.at(i);
-    }
+   U32 length = startingURL.length();
+   for(U32 i = 0; i < length; 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;
-    statusCode = system(runCommand.c_str());
+   S32 statusCode;
+   statusCode = system(runCommand.c_str());
 
-    if(statusCode == 0)
-        return true;
+   if(statusCode == 0)
+   {
+      return true;
+   }
 
-    return false;
+   return false;
 }
 
 #ifdef TORQUE_DEDICATED