From 3e46b4862ab919981e098cd3a3cfc5c12e2fd6c3 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 3 Jun 2014 19:42:47 -0300 Subject: Do not plot pictures that don't have a timestamp. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'qt-ui/profile') diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index e4cf384cf..67b0c4b9f 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -1295,10 +1295,16 @@ void ProfileWidget2::plotPictures() pictures.clear(); DivePictureModel *m = DivePictureModel::instance(); - for(int i = 0; i < m->rowCount(); i++){ + for (int i = 0; i < m->rowCount(); i++) { + struct picture *pic = (struct picture*) m->index(i,1).data(Qt::UserRole).value(); + // it's a correct picture, but doesn't have a timestamp: only show on the widget near the + // information area. + if (!pic->timestamp) + continue; DivePixmapItem *item = new DivePixmapItem(); item->setPixmap(m->index(i,0).data(Qt::DecorationRole).value()); - item->setPos(10,10); // TODO: put the item in the correct place. + // TODO: put the item in the correct place. use the pic.timestamp to find where it belongs on the dive. + item->setPos(10 ,10); item->setFlag(QGraphicsItem::ItemIgnoresTransformations); scene()->addItem(item); pictures.push_back(item); -- cgit v1.2.3-70-g09d2