mirror of
https://gitlab.com/Syping/luaengineapp.git
synced 2024-12-22 20:05:30 +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) {
|
if (getArgumentCount(L_p) >= 1) {
|
||||||
int processReturn = 0;
|
int processReturn = 0;
|
||||||
bool runInBackground = false;
|
bool runInBackground = false;
|
||||||
bool processExecuted = false;
|
bool processSuccessed = false;
|
||||||
if (getArgumentCount(L_p) >= 2) {
|
if (getArgumentCount(L_p) >= 2) {
|
||||||
QVariantList arguments = getArguments(L_p);
|
QVariantList arguments = getArguments(L_p);
|
||||||
QVariant lastArgument = arguments.last();
|
QVariant lastArgument = arguments.last();
|
||||||
|
@ -53,7 +53,7 @@ int LuaEngineOS::executeProcess(lua_State *L_p)
|
||||||
processArguments << argument.toString();
|
processArguments << argument.toString();
|
||||||
}
|
}
|
||||||
if (runInBackground) {
|
if (runInBackground) {
|
||||||
processExecuted = QProcess::startDetached(processPath, processArguments);
|
processSuccessed = QProcess::startDetached(processPath, processArguments);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
processReturn = QProcess::execute(processPath, processArguments);
|
processReturn = QProcess::execute(processPath, processArguments);
|
||||||
|
@ -61,7 +61,7 @@ int LuaEngineOS::executeProcess(lua_State *L_p)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (runInBackground) {
|
if (runInBackground) {
|
||||||
processExecuted = QProcess::startDetached(arguments.first().toString());
|
processSuccessed = QProcess::startDetached(arguments.first().toString());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
processReturn = QProcess::execute(arguments.first().toString());
|
processReturn = QProcess::execute(arguments.first().toString());
|
||||||
|
@ -71,13 +71,13 @@ int LuaEngineOS::executeProcess(lua_State *L_p)
|
||||||
else {
|
else {
|
||||||
processReturn = QProcess::execute(getVariant(L_p, 1).toString());
|
processReturn = QProcess::execute(getVariant(L_p, 1).toString());
|
||||||
}
|
}
|
||||||
if (runInBackground && !processExecuted) {
|
if (runInBackground && !processSuccessed) {
|
||||||
processReturn = -2;
|
processReturn = -2;
|
||||||
}
|
}
|
||||||
else if (!runInBackground && processReturn != -2) {
|
else if (!runInBackground && processReturn == 0) {
|
||||||
processExecuted = true;
|
processSuccessed = true;
|
||||||
}
|
}
|
||||||
pushVariant(L_p, processExecuted);
|
pushVariant(L_p, processSuccessed);
|
||||||
pushVariant(L_p, processReturn);
|
pushVariant(L_p, processReturn);
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue