summaryrefslogtreecommitdiffstats
path: root/qt-ui/divepicturewidget.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-07-29 23:03:32 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-30 12:52:31 -0700
commit3b9bceacb6efcd3e97c95077a2295c931c834514 (patch)
treec40ae2d7529f5fd6aab9d9041c785202fe0c61a0 /qt-ui/divepicturewidget.cpp
parent1e6986d87010a636d151f77b3da2a40d52a95178 (diff)
downloadsubsurface-3b9bceacb6efcd3e97c95077a2295c931c834514.tar.gz
Implement the functionality of remove_picture.
Added the remove_picture functionality, with code shamelessy stolen from remove_event, and hoock it up with the interface. Fixes #650 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/divepicturewidget.cpp')
-rw-r--r--qt-ui/divepicturewidget.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/qt-ui/divepicturewidget.cpp b/qt-ui/divepicturewidget.cpp
index fd64f613a..76d3e7c65 100644
--- a/qt-ui/divepicturewidget.cpp
+++ b/qt-ui/divepicturewidget.cpp
@@ -89,11 +89,21 @@ QVariant DivePictureModel::data(const QModelIndex &index, int role) const
switch (role) {
case Qt::UserRole:
ret = QVariant::fromValue((void *)stringPixmapCache[key].picture);
+ break;
+ case Qt::DisplayRole:
+ ret = key;
}
}
return ret;
}
+void DivePictureModel::removePicture(const QString &fileUrl)
+{
+ dive_remove_picture(stringPixmapCache[fileUrl].picture);
+ copy_dive(current_dive, &displayed_dive);
+ updateDivePictures();
+}
+
int DivePictureModel::rowCount(const QModelIndex &parent) const
{
return numberOfPictures;