X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2FSystemcall.cpp;h=cc2c3814ab761c17ec360316f1b071e7ea5e21aa;hb=c0000cc405063044fb4eca3f04ab35f69fe3dd74;hp=0e4cec7ee2e73e7f748c23b7123dc222b903ad80;hpb=306b136cc005a1aeb9a6861ee0ac6fe2a2dd53e3;p=lyx.git diff --git a/src/support/Systemcall.cpp b/src/support/Systemcall.cpp index 0e4cec7ee2..cc2c3814ab 100644 --- a/src/support/Systemcall.cpp +++ b/src/support/Systemcall.cpp @@ -23,6 +23,7 @@ #include "support/os.h" #include "support/ProgressInterface.h" +#include "LyX.h" #include "LyXRC.h" #include @@ -239,7 +240,10 @@ int Systemcall::startscript(Starttype how, string const & what, bool process_events) { string const what_ss = commandPrep(what); - LYXERR(Debug::INFO,"Running: " << what_ss); + if (verbose) + lyxerr << "\nRunning: " << what_ss << endl; + else + LYXERR(Debug::INFO,"Running: " << what_ss); string infile; string outfile; @@ -295,16 +299,10 @@ int Systemcall::startscript(Starttype how, string const & what, } -SystemcallPrivate::SystemcallPrivate(std::string const & sf, - std::string const & of, - std::string const & ef) : - process_(new QProcess), - out_index_(0), - err_index_(0), - in_file_(sf), - out_file_(of), - err_file_(ef), - process_events_(false) +SystemcallPrivate::SystemcallPrivate(std::string const & sf, std::string const & of, + std::string const & ef) + : state(Error), process_(new QProcess), out_index_(0), err_index_(0), + in_file_(sf), out_file_(of), err_file_(ef), process_events_(false) { if (!in_file_.empty()) process_->setStandardInputFile(QString::fromLocal8Bit(in_file_.c_str())); @@ -357,7 +355,11 @@ SystemcallPrivate::SystemcallPrivate(std::string const & sf, connect(process_, SIGNAL(readyReadStandardOutput()), SLOT(stdOut())); connect(process_, SIGNAL(readyReadStandardError()), SLOT(stdErr())); +#if QT_VERSION >= 0x050600 + connect(process_, SIGNAL(errorOccurred(QProcess::ProcessError)), SLOT(processError(QProcess::ProcessError))); +#else connect(process_, SIGNAL(error(QProcess::ProcessError)), SLOT(processError(QProcess::ProcessError))); +#endif connect(process_, SIGNAL(started()), this, SLOT(processStarted())); connect(process_, SIGNAL(finished(int, QProcess::ExitStatus)), SLOT(processFinished(int, QProcess::ExitStatus))); }