musredit_qt5: adopted call of musrview such that it works under macOS 10.12

This commit is contained in:
suter_a 2016-11-15 08:58:13 +01:00
parent ea841ec186
commit 19d5c09b45

View File

@ -2205,9 +2205,22 @@ void PTextEdit::musrView()
if (fAdmin->getMusrviewShowFourierFlag())
arg << "-f";
QProcess proc(this);
if (!proc.startDetached(cmd, arg, workDir)) {
QMessageBox::critical(this, "ERROR", "**ERROR** musrview process couldn't be launched properly, sorry.");
QProcess *proc = new QProcess(this);
// make sure that the system environment variables are properly set
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("LD_LIBRARY_PATH", env.value("ROOTSYS") + "/lib:" + env.value("LD_LIBRARY_PATH"));
proc->setProcessEnvironment(env);
proc->setWorkingDirectory(workDir);
proc->start(cmd, arg);
if (!proc->waitForStarted()) {
// error handling
QString msg(tr("Could not execute the output command: ")+cmd[0]);
QMessageBox::critical( 0,
tr("Fatal error"),
msg,
tr("Quit") );
return;
}
}