mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Context menu for images: change DivePicture model
Altering DivePicture model to allow deleting images from the QListView without immediate updating of the list. Updating is determined by an additioanl parameter Signed-off-by: Guido Lerch <guido.lerch@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
3c3523f9b8
commit
8ce471c2f5
2 changed files with 7 additions and 5 deletions
|
@ -111,12 +111,14 @@ QVariant DivePictureModel::data(const QModelIndex &index, int role) const
|
|||
return ret;
|
||||
}
|
||||
|
||||
void DivePictureModel::removePicture(const QString &fileUrl)
|
||||
void DivePictureModel::removePicture(const QString &fileUrl, bool last)
|
||||
{
|
||||
dive_remove_picture(fileUrl.toUtf8().data());
|
||||
copy_dive(current_dive, &displayed_dive);
|
||||
updateDivePictures();
|
||||
mark_divelist_changed(true);
|
||||
if (last) {
|
||||
copy_dive(current_dive, &displayed_dive);
|
||||
updateDivePictures();
|
||||
mark_divelist_changed(true);
|
||||
}
|
||||
}
|
||||
|
||||
int DivePictureModel::rowCount(const QModelIndex &parent) const
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
virtual void updateDivePictures();
|
||||
void updateDivePicturesWhenDone(QList<QFuture<void> >);
|
||||
void removePicture(const QString& fileUrl);
|
||||
void removePicture(const QString& fileUrl, bool last);
|
||||
|
||||
protected:
|
||||
DivePictureModel();
|
||||
|
|
Loading…
Reference in a new issue