aboutsummaryrefslogtreecommitdiff
path: root/libLumina/LuminaUtils.cpp
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-09-30 09:22:24 -0400
committerKen Moore <moorekou@gmail.com>2015-09-30 09:22:24 -0400
commit737758065cac5781b31e559220ad7635f7116408 (patch)
tree0b8d3de899e924dc97930dc48fb43ef283fbbdf2 /libLumina/LuminaUtils.cpp
parentAdjust the window geometry movement routine a bit more. Now it will only run ... (diff)
downloadlumina-737758065cac5781b31e559220ad7635f7116408.tar.gz
lumina-737758065cac5781b31e559220ad7635f7116408.tar.bz2
lumina-737758065cac5781b31e559220ad7635f7116408.zip
Fix an issue with the runCmd() and getCmdOutput() functions in libLumina - ensure that the process was started first before going into the "wait loop" afterwards. This should fix race conditions where Lumina was trying to call an application which was not installed on the system, or the application does not startup for some reason.
Diffstat (limited to 'libLumina/LuminaUtils.cpp')
-rw-r--r--libLumina/LuminaUtils.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libLumina/LuminaUtils.cpp b/libLumina/LuminaUtils.cpp
index 60605e65..5f2de8b3 100644
--- a/libLumina/LuminaUtils.cpp
+++ b/libLumina/LuminaUtils.cpp
@@ -36,6 +36,7 @@ int LUtils::runCmd(QString cmd, QStringList args){
}else{
proc.start(cmd, args);
}
+ if(!proc.waitForStarted(30000)){ return 1; } //process never started - max wait of 30 seconds
while(!proc.waitForFinished(300)){
QCoreApplication::processEvents();
}
@@ -56,6 +57,7 @@ QStringList LUtils::getCmdOutput(QString cmd, QStringList args){
}else{
proc.start(cmd,args);
}
+ if(!proc.waitForStarted(30000)){ return QStringList(); } //process never started - max wait of 30 seconds
while(!proc.waitForFinished(500)){
QCoreApplication::processEvents();
}
bgstack15