From 1604299a5b4ed183187d7cb13df445d306eda60e Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 8 Jun 2014 17:17:49 -0700 Subject: 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 --- qt-ui/profile/profilewidget2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qt-ui/profile/profilewidget2.cpp') 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(); // 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()); // 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 -- cgit v1.2.3-70-g09d2