mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Dive pictures: don't update all images on drag&drop to profile
Gracefully handle drag & drop to the profile, which changes the offset of the pictures. To do this, keep the pictures in the DivePictureModel and the ProfileWidget2 sorted by offset and re-arrange if needed to keep the list sorted. This needs some code reshuffling. Introduce a helper-function that moves ranges in arrays. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
0aaa1bf386
commit
9efb56e2d4
5 changed files with 174 additions and 38 deletions
|
@ -7,6 +7,7 @@
|
|||
#include <QFuture>
|
||||
|
||||
struct PictureEntry {
|
||||
int diveId;
|
||||
struct picture *picture;
|
||||
QString filename;
|
||||
QImage image;
|
||||
|
@ -22,7 +23,7 @@ public:
|
|||
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
virtual void updateDivePictures();
|
||||
void removePictures(const QVector<QString> &fileUrls);
|
||||
void updateDivePictureOffset(const QString &filename, int offsetSeconds);
|
||||
void updateDivePictureOffset(int diveId, const QString &filename, int offsetSeconds);
|
||||
signals:
|
||||
void picturesRemoved(const QVector<QString> &fileUrls);
|
||||
public slots:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue