aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/profilewidget2.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-06-03 19:42:47 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-03 16:47:43 -0700
commit3e46b4862ab919981e098cd3a3cfc5c12e2fd6c3 (patch)
tree8c25723c562c1f1d243d3112737f13f52ec498e3 /qt-ui/profile/profilewidget2.cpp
parentb1847f9ebb45fcdeb4488f8acd7df2b9ee75906a (diff)
downloadsubsurface-3e46b4862ab919981e098cd3a3cfc5c12e2fd6c3.tar.gz
Do not plot pictures that don't have a timestamp.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/profilewidget2.cpp')
-rw-r--r--qt-ui/profile/profilewidget2.cpp10
1 files changed, 8 insertions, 2 deletions
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<void*>();
+ // 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<QPixmap>());
- 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);