From 588859ca3a2166df97d340793790709fc32fca78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sat, 21 Jul 2018 21:11:37 +0200 Subject: [PATCH] Code cleanup --- src/GUI/gui.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/GUI/gui.cpp b/src/GUI/gui.cpp index 558a71f5..3f4a3d81 100644 --- a/src/GUI/gui.cpp +++ b/src/GUI/gui.cpp @@ -984,9 +984,7 @@ void GUI::plot(QPrinter *printer) QPainter p(printer); TrackInfo info; qreal ih, gh, mh, ratio; - qreal d = distance(); - qreal t = time(); - qreal tm = movingTime(); + if (!_pathName.isNull() && _options.printName) info.insert(tr("Name"), _pathName); @@ -1012,12 +1010,12 @@ void GUI::plot(QPrinter *printer) } } - if (d > 0 && _options.printDistance) - info.insert(tr("Distance"), Format::distance(d, units())); - if (t > 0 && _options.printTime) - info.insert(tr("Time"), Format::timeSpan(t)); - if (tm > 0 && _options.printMovingTime) - info.insert(tr("Moving time"), Format::timeSpan(tm)); + if (distance() > 0 && _options.printDistance) + info.insert(tr("Distance"), Format::distance(distance(), units())); + if (time() > 0 && _options.printTime) + info.insert(tr("Time"), Format::timeSpan(time())); + if (movingTime() > 0 && _options.printMovingTime) + info.insert(tr("Moving time"), Format::timeSpan(movingTime())); qreal fsr = 1085.0 / (qMax(printer->width(), printer->height()) / (qreal)printer->resolution());