mirror of
https://gitlab.com/Syping/luaengineapp.git
synced 2024-12-22 11:55:29 +01:00
replace processExecuted with processSuccessed
This commit is contained in:
parent
71c86ba217
commit
49545db0dc
1 changed files with 7 additions and 7 deletions
|
@ -37,7 +37,7 @@ int LuaEngineOS::executeProcess(lua_State *L_p)
|
|||
if (getArgumentCount(L_p) >= 1) {
|
||||
int processReturn = 0;
|
||||
bool runInBackground = false;
|
||||
bool processExecuted = false;
|
||||
bool processSuccessed = false;
|
||||
if (getArgumentCount(L_p) >= 2) {
|
||||
QVariantList arguments = getArguments(L_p);
|
||||
QVariant lastArgument = arguments.last();
|
||||
|
@ -53,7 +53,7 @@ int LuaEngineOS::executeProcess(lua_State *L_p)
|
|||
processArguments << argument.toString();
|
||||
}
|
||||
if (runInBackground) {
|
||||
processExecuted = QProcess::startDetached(processPath, processArguments);
|
||||
processSuccessed = QProcess::startDetached(processPath, processArguments);
|
||||
}
|
||||
else {
|
||||
processReturn = QProcess::execute(processPath, processArguments);
|
||||
|
@ -61,7 +61,7 @@ int LuaEngineOS::executeProcess(lua_State *L_p)
|
|||
}
|
||||
else {
|
||||
if (runInBackground) {
|
||||
processExecuted = QProcess::startDetached(arguments.first().toString());
|
||||
processSuccessed = QProcess::startDetached(arguments.first().toString());
|
||||
}
|
||||
else {
|
||||
processReturn = QProcess::execute(arguments.first().toString());
|
||||
|
@ -71,13 +71,13 @@ int LuaEngineOS::executeProcess(lua_State *L_p)
|
|||
else {
|
||||
processReturn = QProcess::execute(getVariant(L_p, 1).toString());
|
||||
}
|
||||
if (runInBackground && !processExecuted) {
|
||||
if (runInBackground && !processSuccessed) {
|
||||
processReturn = -2;
|
||||
}
|
||||
else if (!runInBackground && processReturn != -2) {
|
||||
processExecuted = true;
|
||||
else if (!runInBackground && processReturn == 0) {
|
||||
processSuccessed = true;
|
||||
}
|
||||
pushVariant(L_p, processExecuted);
|
||||
pushVariant(L_p, processSuccessed);
|
||||
pushVariant(L_p, processReturn);
|
||||
return 2;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue