Delete parametr name and use last parameter in string list instead.

--HG--
branch : feature
This commit is contained in:
dismine 2014-03-14 20:47:50 +02:00
parent de85cad839
commit 2cddab80d4
2 changed files with 6 additions and 8 deletions

View File

@ -499,7 +499,7 @@ void TableWindow::EpsFile(const QString &name) const
QStringList params; QStringList params;
params << "-eps" << tmp.fileName() << name; params << "-eps" << tmp.fileName() << name;
PdfToPs(name, params); PdfToPs(params);
} }
} }
@ -513,12 +513,11 @@ void TableWindow::PsFile(const QString &name) const
QStringList params; QStringList params;
params << tmp.fileName() << name; params << tmp.fileName() << name;
PdfToPs(name, params); PdfToPs(params);
} }
} }
//TODO delete parametr name and use last parameter in string list instead. void TableWindow::PdfToPs(const QStringList &params) const
void TableWindow::PdfToPs(const QString &name, const QStringList &params) const
{ {
#ifndef QT_NO_CURSOR #ifndef QT_NO_CURSOR
QApplication::setOverrideCursor(Qt::WaitCursor); QApplication::setOverrideCursor(Qt::WaitCursor);
@ -534,10 +533,10 @@ void TableWindow::PdfToPs(const QString &name, const QStringList &params) const
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
#endif #endif
QFile f(name); QFile f(params.last());
if (f.exists() == false) if (f.exists() == false)
{ {
QString msg = QString(tr("Creating file '%1' failed! %2")).arg(name).arg(proc.errorString()); QString msg = QString(tr("Creating file '%1' failed! %2")).arg(params.last()).arg(proc.errorString());
QMessageBox msgBox(QMessageBox::Critical, tr("Critical error!"), msg, QMessageBox::Ok | QMessageBox::Default); QMessageBox msgBox(QMessageBox::Critical, tr("Critical error!"), msg, QMessageBox::Ok | QMessageBox::Default);
msgBox.exec(); msgBox.exec();
} }

View File

@ -225,11 +225,10 @@ private:
void PsFile(const QString &name)const; void PsFile(const QString &name)const;
/** /**
* @brief PdfToPs use external tool "pdftops" for converting pdf too eps or ps format. * @brief PdfToPs use external tool "pdftops" for converting pdf too eps or ps format.
* @param name name output file.
* @param params string with parameter for tool. Parameters have format: "-eps input_file out_file". Use -eps when * @param params string with parameter for tool. Parameters have format: "-eps input_file out_file". Use -eps when
* need create eps file. * need create eps file.
*/ */
void PdfToPs(const QString &name, const QStringList &params)const; void PdfToPs(const QStringList &params)const;
}; };
#endif // TABLEWINDOW_H #endif // TABLEWINDOW_H