From fd45e646dcee98978b85d4776dfbec2eb1587076 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 23 Jan 2014 16:12:18 -0200 Subject: Added comments explaining why the events are created on the setDive Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'qt-ui/profile') diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 2f7505d22..568b90889 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -365,9 +365,11 @@ void ProfileWidget2::plotDives(QList dives) meanDepth->animateMoveTo(3, profileYAxis->posAtValue(pInfo.meandepth)); dataModel->setDive(current_dive, pInfo); + // The event items are a bit special since we don't know how many events are going to + // exist on a dive, so I cant create cache items for that. that's why they are here + // while all other items are up there on the constructor. qDeleteAll(eventItems); eventItems.clear(); - struct event *event = currentdc->events; while (event) { DiveEventItem *item = new DiveEventItem(); -- cgit v1.2.3-70-g09d2