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>
This commit is contained in:
Tomaz Canabrava 2014-07-29 22:13:14 -03:00 committed by Dirk Hohndel
parent 75aafdc715
commit 1e6986d870
3 changed files with 12 additions and 14 deletions

View file

@ -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);