mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-20 07:58:44 +00:00
Changed: Use "open" to open other programs too under OS X
--HG-- branch : develop
This commit is contained in:
parent
d8ddb1fd11
commit
9b52f6bc28
1 changed files with 5 additions and 17 deletions
|
@ -753,25 +753,13 @@ bool launchProgram(const std::string &programName, const std::string &arguments,
|
|||
}
|
||||
|
||||
#elif defined(NL_OS_MAC)
|
||||
std::string command;
|
||||
// we need to open bundles with "open" command
|
||||
std::string command = NLMISC::toString("open \"%s\"", programName.c_str());
|
||||
|
||||
if (CFile::getExtension(programName) == "app")
|
||||
// append arguments if any
|
||||
if (!arguments.empty())
|
||||
{
|
||||
// we need to open bundles with "open" command
|
||||
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;
|
||||
command += NLMISC::toString(" --args %s", arguments.c_str());
|
||||
}
|
||||
|
||||
int res = system(command.c_str());
|
||||
|
|
Loading…
Reference in a new issue