diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-06-08 17:17:49 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-06-08 17:17:49 -0700 |
commit | 1604299a5b4ed183187d7cb13df445d306eda60e (patch) | |
tree | 35d61548a77ed5f0a2ded4e603ca9ba50d6788e8 /qt-ui/profile | |
parent | 3a14076b1d1cbf78587305cc83802a1a9ae4c38c (diff) | |
download | subsurface-1604299a5b4ed183187d7cb13df445d306eda60e.tar.gz |
Picture handling: change data structure to store offset instead timestamp
It makes no sense to store a 64bit time stamp with every picture. Even the
32bit offset (in seconds) from the dive start is WAY overkill. But
switching to that makes the code much more simple in a number of spots.
And makes what is saved to the XML file easier to read, too.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile')
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 8374006bc..c709e9389 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -1307,13 +1307,13 @@ void ProfileWidget2::plotPictures() 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) + if (!pic->offset) continue; DivePictureItem *item = new DivePictureItem(); item->setPixmap(m->index(i,0).data(Qt::DecorationRole).value<QPixmap>()); // let's put the picture at the correct time, but at a fixed "depth" on the profile // not sure this is ideal, but it seems to look right. - x = timeAxis->posAtValue(pic->timestamp - current_dive->when); + x = timeAxis->posAtValue(pic->offset); if (i == 0) y = 10; else |