diff options
author | Daniel Wilhelm <shieldwed@outlook.com> | 2019-05-12 22:44:22 +0000 |
---|---|---|
committer | Daniel Wilhelm <shieldwed@outlook.com> | 2019-05-12 22:44:22 +0000 |
commit | 2cb4599782d970f386a67dfd4f4dab0d531d4348 (patch) | |
tree | b873b15f50a981aacf8bb49fd646bfded2e7a73b /zen/shell_execute.h | |
parent | Merge branch '10.11' into 'master' (diff) | |
parent | 10.12 (diff) | |
download | FreeFileSync-2cb4599782d970f386a67dfd4f4dab0d531d4348.tar.gz FreeFileSync-2cb4599782d970f386a67dfd4f4dab0d531d4348.tar.bz2 FreeFileSync-2cb4599782d970f386a67dfd4f4dab0d531d4348.zip |
Merge branch '10.12' into 'master'10.12
10.12
See merge request opensource-tracking/FreeFileSync!9
Diffstat (limited to 'zen/shell_execute.h')
-rw-r--r-- | zen/shell_execute.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/zen/shell_execute.h b/zen/shell_execute.h index 98824d70..19945a0b 100644 --- a/zen/shell_execute.h +++ b/zen/shell_execute.h @@ -27,7 +27,7 @@ namespace { -void shellExecute(const Zstring& command, ExecutionType type) //throw FileError +void shellExecute(const Zstring& command, ExecutionType type, bool hideConsole) //throw FileError { /* we cannot use wxExecute due to various issues: @@ -35,14 +35,13 @@ void shellExecute(const Zstring& command, ExecutionType type) //throw FileError - does not provide any reasonable error information - uses a zero-sized dummy window as a hack to keep focus which leaves a useless empty icon in ALT-TAB list in Windows */ - if (type == ExecutionType::SYNC) { //Posix ::system() - execute a shell command const int rv = ::system(command.c_str()); //do NOT use std::system as its documentation says nothing about "WEXITSTATUS(rv)", etc... if (rv == -1 || WEXITSTATUS(rv) == 127) throw FileError(_("Incorrect command line:") + L"\n" + utfTo<std::wstring>(command)); - //http://linux.die.net/man/3/system "In case /bin/sh could not be executed, the exit status will be that of a command that does exit(127)" + //http://linux.die.net/man/3/system "In case /bin/sh could not be executed, the exit status will be that of a command that does exit(127)" //Bonus: For an incorrect command line /bin/sh also returns with 127! } else @@ -73,7 +72,7 @@ void shellExecute(const Zstring& command, ExecutionType type) //throw FileError inline void openWithDefaultApplication(const Zstring& itemPath) //throw FileError { - shellExecute("xdg-open \"" + itemPath + '"', ExecutionType::ASYNC); // + shellExecute("xdg-open \"" + itemPath + '"', ExecutionType::ASYNC, false/*hideConsole*/); // } } |