summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/profilewidget2.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-07-29 22:13:14 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-30 12:34:43 -0700
commit1e6986d87010a636d151f77b3da2a40d52a95178 (patch)
tree72fba4d0f44d5bb4bdfe4c7e7e45477c5c449f98 /qt-ui/profile/profilewidget2.cpp
parent75aafdc7152747f423e0dacc524c61c5619382e8 (diff)
downloadsubsurface-1e6986d87010a636d151f77b3da2a40d52a95178.tar.gz
Instead of holding the index, hold the URL.
Since the idea is to remove the picture in the future, we need to not hold the row on the model, as when we delete one, the other pictures will change the row. but the QUrl is unique. 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.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index b601af36e..21f0cb4e4 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -1366,8 +1366,9 @@ void ProfileWidget2::plotPictures()
// information area.
if (!pic->offset.seconds)
continue;
- DivePictureItem *item = new DivePictureItem(i);
+ DivePictureItem *item = new DivePictureItem();
item->setPixmap(m->index(i,0).data(Qt::DecorationRole).value<QPixmap>());
+ item->setFileUrl(m->index(i,0).data(Qt::DisplayPropertyRole).toString());
// 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->offset.seconds);