From d97cc8d4d546634bc6e6710111590abd724795c8 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 8 Oct 2021 21:11:37 +0200 Subject: [PATCH] profile: remove TankItem::plotEndTime member variable That variable was only used in a single function and always reset at the beginning of the function. No point in being a member variable. Signed-off-by: Berthold Stoeger --- profile-widget/tankitem.cpp | 7 ++----- profile-widget/tankitem.h | 1 - 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/profile-widget/tankitem.cpp b/profile-widget/tankitem.cpp index f2a87aaa4..ff4bd99d3 100644 --- a/profile-widget/tankitem.cpp +++ b/profile-widget/tankitem.cpp @@ -12,7 +12,6 @@ static const double border = 1.0; TankItem::TankItem(const DiveCartesianAxis &axis, double dpr) : hAxis(axis), - plotEndTime(-1), dpr(dpr) { QColor red(PERSIANRED1); @@ -71,14 +70,12 @@ void TankItem::setData(const struct plot_info *plotInfo, const struct dive *d) return; // If there is nothing to plot, quit early. - if (plotInfo->nr <= 0) { - plotEndTime = -1; + if (plotInfo->nr <= 0) return; - } // Find correct end of the dive plot for correct end of the tankbar. const struct plot_data *last_entry = &plotInfo->entry[plotInfo->nr - 1]; - plotEndTime = last_entry->sec; + int plotEndTime = last_entry->sec; // We don't have enougth data to calculate things, quit. if (plotEndTime < 0) diff --git a/profile-widget/tankitem.h b/profile-widget/tankitem.h index 526b91edd..66a942a8c 100644 --- a/profile-widget/tankitem.h +++ b/profile-widget/tankitem.h @@ -20,7 +20,6 @@ public: private: void createBar(int startTime, int stopTime, struct gasmix gas); const DiveCartesianAxis &hAxis; - int plotEndTime; double dpr; QBrush air, nitrox, oxygen, trimix; QList rects;