QProcess show message "unknown error" when did not exist error.
--HG-- branch : develop
This commit is contained in:
parent
87f2621037
commit
95e02fc043
|
@ -511,30 +511,25 @@ void TableWindow::PsFile(const QString &name) const
|
||||||
//TODO delete parametr name and use last parameter in string list instead.
|
//TODO delete parametr name and use last parameter in string list instead.
|
||||||
void TableWindow::PdfToPs(const QString &name, const QStringList ¶ms) const
|
void TableWindow::PdfToPs(const QString &name, const QStringList ¶ms) const
|
||||||
{
|
{
|
||||||
QProcess proc;
|
|
||||||
QString program;
|
|
||||||
|
|
||||||
#ifdef Q_OS_WIN32
|
|
||||||
program = "pdftops.exe";
|
|
||||||
#else
|
|
||||||
program = "pdftops";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef QT_NO_CURSOR
|
#ifndef QT_NO_CURSOR
|
||||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||||
#endif
|
#endif
|
||||||
proc.start(program, params);
|
QProcess proc;
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
proc.start("pdftops.exe", params);
|
||||||
|
#else
|
||||||
|
proc.start("pdftops", params);
|
||||||
|
#endif
|
||||||
proc.waitForFinished(15000);
|
proc.waitForFinished(15000);
|
||||||
#ifndef QT_NO_CURSOR
|
#ifndef QT_NO_CURSOR
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
#endif
|
#endif
|
||||||
qDebug() << proc.errorString();
|
|
||||||
|
|
||||||
QFile f(name);
|
QFile f(name);
|
||||||
if (!f.exists())
|
if (!f.exists())
|
||||||
{
|
{
|
||||||
QMessageBox msgBox(QMessageBox::Critical, "Critical error!", "Creating file '"+name+"' failed!",
|
QString msg = QString(tr("Creating file '%1' failed! %2")).arg(name).arg(proc.errorString());
|
||||||
QMessageBox::Ok | QMessageBox::Default);
|
QMessageBox msgBox(QMessageBox::Critical, tr("Critical error!"), msg, QMessageBox::Ok | QMessageBox::Default);
|
||||||
msgBox.exec();
|
msgBox.exec();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user