Fix errors in linux conditional code

This commit is contained in:
Phil Olynyk 2019-06-12 23:27:46 -04:00
parent c1d73636a2
commit 917890e077

View File

@ -1202,18 +1202,18 @@ void Statistics::printReport(QWidget * parent) {
#ifdef Q_OS_LINUX
printer.setPrinterName("Print to File (PDF)");
printer.setOutputFormat(QPrinter::PdfFormat);
QString name;
QString datestr;
QString name = "Statistics";
QString datestr = QDate::currentDate().toString(Qt::ISODate);
if (ui->tabWidget->currentWidget() == ui->statisticsTab) {
name = "Statistics";
datestr = QDate::currentDate().toString(Qt::ISODate);
} else if (ui->tabWidget->currentWidget() == ui->helpTab) {
name = "Help";
datestr = QDateTime::currentDateTime().toString(Qt::ISODate);
} else { name = "Unknown"; }
// if (ui->tabWidget->currentWidget() == ui->statisticsTab) {
// name = "Statistics";
// datestr = QDate::currentDate().toString(Qt::ISODate);
// } else if (ui->tabWidget->currentWidget() == ui->helpTab) {
// name = "Help";
// datestr = QDateTime::currentDateTime().toString(Qt::ISODate);
// } else { name = "Unknown"; }
QString filename = p_pref->Get("{home}/" + name + "_" + p_profile->user->userName() + "_" + datestr + ".pdf");
QString filename = p_pref->Get("{home}/") + name + "_" + p_profile->user->userName() + "_" + datestr + ".pdf";
printer.setOutputFileName(filename);
#endif