From 2cddab80d4ad9a6e484bdb49faeb3caed8b936de Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 14 Mar 2014 20:47:50 +0200 Subject: [PATCH] Delete parametr name and use last parameter in string list instead. --HG-- branch : feature --- src/tablewindow.cpp | 11 +++++------ src/tablewindow.h | 3 +-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/tablewindow.cpp b/src/tablewindow.cpp index 06e23ce0e..af06035b1 100644 --- a/src/tablewindow.cpp +++ b/src/tablewindow.cpp @@ -499,7 +499,7 @@ void TableWindow::EpsFile(const QString &name) const QStringList params; params << "-eps" << tmp.fileName() << name; - PdfToPs(name, params); + PdfToPs(params); } } @@ -513,12 +513,11 @@ void TableWindow::PsFile(const QString &name) const QStringList params; 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 QString &name, const QStringList ¶ms) const +void TableWindow::PdfToPs(const QStringList ¶ms) const { #ifndef QT_NO_CURSOR QApplication::setOverrideCursor(Qt::WaitCursor); @@ -534,10 +533,10 @@ void TableWindow::PdfToPs(const QString &name, const QStringList ¶ms) const QApplication::restoreOverrideCursor(); #endif - QFile f(name); + QFile f(params.last()); 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); msgBox.exec(); } diff --git a/src/tablewindow.h b/src/tablewindow.h index 026bda81d..2db91a8ff 100644 --- a/src/tablewindow.h +++ b/src/tablewindow.h @@ -225,11 +225,10 @@ private: void PsFile(const QString &name)const; /** * @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 * need create eps file. */ - void PdfToPs(const QString &name, const QStringList ¶ms)const; + void PdfToPs(const QStringList ¶ms)const; }; #endif // TABLEWINDOW_H