mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
1e6986d870
commit
3b9bceacb6
6 changed files with 32 additions and 8 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue