summaryrefslogtreecommitdiff
path: root/zen/shell_execute.h
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2019-05-12 16:34:13 -0400
committerB Stack <bgstack15@gmail.com>2019-05-12 16:34:13 -0400
commitf43972d665c95b2148636c86a5b648e719901101 (patch)
treeb873b15f50a981aacf8bb49fd646bfded2e7a73b /zen/shell_execute.h
parentMerge branch '10.11' into 'master' (diff)
downloadFreeFileSync-f43972d665c95b2148636c86a5b648e719901101.tar.gz
FreeFileSync-f43972d665c95b2148636c86a5b648e719901101.tar.bz2
FreeFileSync-f43972d665c95b2148636c86a5b648e719901101.zip
10.12
Diffstat (limited to 'zen/shell_execute.h')
-rw-r--r--zen/shell_execute.h7
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*/); //
}
}
bgstack15