Fix up ShellEx
It's now crossplatform wrapper for std::system opening of a file/path/url. It returns an int just like std::system, 0 means it worked. It's static so you don't need to gViewerWindow->getWindow() anymore, honestly it should've been static in the first place. Clean up other code to use this function because duplicate code sucks. # Conflicts: # indra/llwindow/llwindowmacosx.h # indra/llwindow/llwindowsdl2.cpp
This commit is contained in:
@@ -252,6 +252,19 @@ BOOL LLWindow::copyTextToPrimary(const LLWString &src)
|
||||
return FALSE; // fail
|
||||
}
|
||||
|
||||
int LLWindow::ShellEx(const std::string& command)
|
||||
{
|
||||
constexpr auto&& open =
|
||||
#if LL_WINDOWS
|
||||
"start \"\" \""; // Quoted first argument is the title of the command prompt
|
||||
#elif LL_DARWIN
|
||||
"open \"";
|
||||
#else // LL_LINUX or other modern unix, pray it has xdg-open
|
||||
"xdg-open \""
|
||||
#endif
|
||||
return std::system((open + command + '"').c_str());
|
||||
}
|
||||
|
||||
// static
|
||||
std::vector<std::string> LLWindow::getDynamicFallbackFontList()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user