From 585ded6b1c6c07011adb6d1b0f05f885dabb668c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20T=C5=AFma?= Date: Sat, 5 Nov 2016 17:37:04 +0100 Subject: [PATCH] Code cleanup --- src/graphitem.cpp | 7 +++---- src/graphitem.h | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/graphitem.cpp b/src/graphitem.cpp index dce41da2..0f576066 100644 --- a/src/graphitem.cpp +++ b/src/graphitem.cpp @@ -15,7 +15,6 @@ GraphItem::GraphItem(const Graph &graph, QGraphicsItem *parent) _type = Distance; _graph = graph; _sx = 1.0; _sy = 1.0; - _time = _graph.hasTime(); updatePath(); updateBounds(); @@ -117,7 +116,7 @@ qreal GraphItem::distanceAtTime(qreal time) void GraphItem::emitSliderPositionChanged(qreal pos) { if (_type == Time) { - if (_time) { + if (_graph.hasTime()) { if (pos <= _graph.last().t()) emit sliderPositionChanged(distanceAtTime(pos)); else @@ -156,7 +155,7 @@ void GraphItem::updatePath() { _path = QPainterPath(); - if (_type == Time && !_time) + if (_type == Time && !_graph.hasTime()) return; _path.moveTo(_graph.first().x(_type) * _sx, -_graph.first().y() * _sy); @@ -166,7 +165,7 @@ void GraphItem::updatePath() void GraphItem::updateBounds() { - if (_type == Time && !_time) { + if (_type == Time && !_graph.hasTime()) { _bounds = QRectF(); return; } diff --git a/src/graphitem.h b/src/graphitem.h index 274d8661..56810ef2 100644 --- a/src/graphitem.h +++ b/src/graphitem.h @@ -44,7 +44,6 @@ private: Graph _graph; GraphType _type; - bool _time; QPainterPath _path; QRectF _bounds; -- 2.11.4.GIT