3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Asger Alstrup
8 * Interface cleaned up by
9 * \author Angus Leeming
11 * Full author contact details are available in file CREDITS.
16 #include "support/debug.h"
17 #include "support/qstring_helpers.h"
18 #include "support/Systemcall.h"
19 #include "support/os.h"
25 #define DISABLE_EVALUATE_QPROCESS
33 int Systemcall::startscript(Starttype how, string const & what)
35 #ifdef DISABLE_EVALUATE_QPROCESS
36 string command = what;
38 if (how == DontWait) {
39 switch (os::shell()) {
44 command = "start /min " + command;
49 return ::system(command.c_str());
51 QString cmd = QString::fromLocal8Bit(what.c_str());
52 QProcess * process = new QProcess;
54 if (!process->waitForStarted(1000)) {
55 LYXERR0("Qprocess " << cmd << " did not start!");
56 LYXERR0("error " << process->error());
57 LYXERR0("state " << process->state());
58 LYXERR0("status " << process->exitStatus());
64 if (!process->waitForFinished(30000)) {
65 LYXERR0("Qprocess " << cmd << " did not finished!");
66 LYXERR0("error " << process->error());
67 LYXERR0("state " << process->state());
68 LYXERR0("status " << process->exitStatus());
71 int const exit_code = process->exitCode();
73 LYXERR0("Qprocess " << cmd << " finished!");
74 LYXERR0("exitCode " << process->exitCode());
75 LYXERR0("error " << process->error());
76 LYXERR0("state " << process->state());
77 LYXERR0("status " << process->exitStatus());
84 } // namespace support