]> git.lyx.org Git - features.git/blobdiff - src/support/Systemcall.cpp
Add some debugging code to QProcess. Reconfigure (python) starts and finishes here...
[features.git] / src / support / Systemcall.cpp
index 038448b4f3d860e16ea54d9aac15105bee91dff0..22b042448f7b1cf3dc9f68522f0348327cf727f2 100644 (file)
@@ -13,6 +13,8 @@
 
 #include <config.h>
 
+#include "support/debug.h"
+#include "support/qstring_helpers.h"
 #include "support/Systemcall.h"
 #include "support/os.h"
 
@@ -46,7 +48,27 @@ int Systemcall::startscript(Starttype how, string const & what)
        QString cmd = QString::fromLocal8Bit(command.c_str());
        QProcess process;
        process.start(cmd);
-       process.waitForFinished();
+       if (!process.waitForStarted(1000)) {
+               LYXERR0("Qprocess " << cmd << " did not start!");
+               LYXERR0("error " << process.error());
+               LYXERR0("state " << process.state());
+               LYXERR0("status " << process.exitStatus());
+               return 10;
+       }
+       if (!process.waitForFinished(30000)) {
+               LYXERR0("Qprocess " << cmd << " did not finished!");
+               LYXERR0("error " << process.error());
+               LYXERR0("state " << process.state());
+               LYXERR0("status " << process.exitStatus());
+               return 20;
+       }
+       if (process.exitCode()) {
+               LYXERR0("Qprocess " << cmd << " finished!");
+               LYXERR0("exitCode " << process.exitCode());
+               LYXERR0("error " << process.error());
+               LYXERR0("state " << process.state());
+               LYXERR0("status " << process.exitStatus());
+       }
        return process.exitCode();
 #endif