Changed: Use "open" to open other programs too under OS X
This commit is contained in:
parent
2274cfff89
commit
e9a39a9a55
1 changed files with 5 additions and 17 deletions
|
@ -753,26 +753,14 @@ bool launchProgram(const std::string &programName, const std::string &arguments,
|
|||
}
|
||||
|
||||
#elif defined(NL_OS_MAC)
|
||||
std::string command;
|
||||
|
||||
if (CFile::getExtension(programName) == "app")
|
||||
{
|
||||
// we need to open bundles with "open" command
|
||||
command = NLMISC::toString("open \"%s\"", programName.c_str());
|
||||
std::string command = NLMISC::toString("open \"%s\"", programName.c_str());
|
||||
|
||||
// append arguments if any
|
||||
if (!arguments.empty())
|
||||
{
|
||||
command += NLMISC::toString(" --args %s", arguments.c_str());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
command = programName;
|
||||
|
||||
// append arguments if any
|
||||
if (!arguments.empty()) command += " " + arguments;
|
||||
}
|
||||
|
||||
int res = system(command.c_str());
|
||||
|
||||
|
|
Loading…
Reference in a new issue