diff options
Diffstat (limited to 'qt-ui/divepicturewidget.cpp')
-rw-r--r-- | qt-ui/divepicturewidget.cpp | 10 |
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; |