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"
31 int Systemcall::startscript(Starttype how, string const & what)
33 string command = what;
35 if (how == DontWait) {
36 switch (os::shell()) {
41 command = "start /min " + command;
46 //#define DISABLE_EVALUATE_QPROCESS
47 #ifndef DISABLE_EVALUATE_QPROCESS
48 QString cmd = QString::fromLocal8Bit(command.c_str());
51 if (!process.waitForStarted(1000)) {
52 LYXERR0("Qprocess " << cmd << " did not start!");
53 LYXERR0("error " << process.error());
54 LYXERR0("state " << process.state());
55 LYXERR0("status " << process.exitStatus());
58 if (!process.waitForFinished(30000)) {
59 LYXERR0("Qprocess " << cmd << " did not finished!");
60 LYXERR0("error " << process.error());
61 LYXERR0("state " << process.state());
62 LYXERR0("status " << process.exitStatus());
65 if (process.exitCode()) {
66 LYXERR0("Qprocess " << cmd << " finished!");
67 LYXERR0("exitCode " << process.exitCode());
68 LYXERR0("error " << process.error());
69 LYXERR0("state " << process.state());
70 LYXERR0("status " << process.exitStatus());
72 return process.exitCode();
75 return ::system(command.c_str());
78 } // namespace support