diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2014-01-22 18:25:35 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-01-22 13:16:31 -0800 |
commit | f8a4f8de8159bb60235af170d2acb603ec40ccad (patch) | |
tree | e03da0dd9782ca35cc0577783dbca22e8bb144fe /qt-ui/profile/diveprofileitem.cpp | |
parent | 629a1ea0f983b38ead21883d87eabd9cda16c9ad (diff) | |
download | subsurface-f8a4f8de8159bb60235af170d2acb603ec40ccad.tar.gz |
Do not delete / new object that can be cached.
This way we will always have this object on screen, and as soon as the
model changes, it's contents will change.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/diveprofileitem.cpp')
-rw-r--r-- | qt-ui/profile/diveprofileitem.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp index 5599b7eaf..e740640e2 100644 --- a/qt-ui/profile/diveprofileitem.cpp +++ b/qt-ui/profile/diveprofileitem.cpp @@ -367,6 +367,8 @@ void DiveCalculatedCeiling::modelDataChanged() AbstractProfilePolygonItem::modelDataChanged(); // Add 2 points to close the polygon. QPolygonF poly = polygon(); + if (poly.isEmpty()) + return; QPointF p1 = poly.first(); QPointF p2 = poly.last(); |