]> git.lyx.org Git - lyx.git/blobdiff - src/support/Systemcall.cpp
Fix build with GNU libstdc++ C++11 ABI
[lyx.git] / src / support / Systemcall.cpp
index 945d96fb6e7915e7025752ef66c12b641ee4194f..28cbdc89999d8721616a700d88d306b16dc59b08 100644 (file)
@@ -71,7 +71,7 @@ public:
 
        void warning(QString const &, QString const &) {}
        void toggleWarning(QString const &, QString const &, QString const &) {}
-       void error(QString const &, QString const &) {}
+       void error(QString const &, QString const &, QString const &) {}
        void information(QString const &, QString const &) {}
        int prompt(docstring const &, docstring const &, int default_but, int,
                   docstring const &, docstring const &) { return default_but; }
@@ -103,14 +103,8 @@ ProgressInterface * ProgressInterface::instance()
 int Systemcall::startscript(Starttype how, string const & what,
                            std::string const & path, bool /*process_events*/)
 {
-       string const python_call = "python -tt";
-       string command = to_filesystem8bit(from_utf8(latexEnvCmdPrefix(path)));
-       string what_ss = libScriptSearch(what);
-
-       if (prefixIs(what_ss, python_call))
-               command += os::python() + what_ss.substr(python_call.length());
-       else
-               command += what_ss;
+       string command = to_filesystem8bit(from_utf8(latexEnvCmdPrefix(path)))
+                      + commandPrep(what);
 
        if (how == DontWait) {
                switch (os::shell()) {
@@ -241,7 +235,7 @@ string const parsecmd(string const & incmd, string & infile, string & outfile,
 int Systemcall::startscript(Starttype how, string const & what,
                            string const & path, bool process_events)
 {
-       string const what_ss = libScriptSearch(what);
+       string const what_ss = commandPrep(what);
        LYXERR(Debug::INFO,"Running: " << what_ss);
 
        string infile;
@@ -583,7 +577,7 @@ QString SystemcallPrivate::errorMessage() const
                        break;
                case QProcess::UnknownError:
                default:
-                       message = "An unknown error occured.";
+                       message = "An unknown error occurred.";
                        break;
        }
        return message;
@@ -613,7 +607,9 @@ QString SystemcallPrivate::exitStatusMessage() const
 
 int SystemcallPrivate::exitCode()
 {
-       if (!process_)
+       // From Qt's documentation, in regards to QProcess::exitCode(),
+       // "This value is not valid unless exitStatus() returns NormalExit"
+       if (!process_ || process_->exitStatus() != QProcess::NormalExit)
                return -1;
 
        return process_->exitCode();