diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-07-02 13:58:06 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-07-03 09:37:55 -0700 |
commit | ce47683de82b3eb0f6e41d3cb5f2b6f035d98afa (patch) | |
tree | 5ebe072430db354587ef3d2be37b8c808d79944f /qt-ui | |
parent | 635a7ab77171e9789f13accfa5904afe27460f70 (diff) | |
download | subsurface-ce47683de82b3eb0f6e41d3cb5f2b6f035d98afa.tar.gz |
UI restructure: always display pictures for displayed dive
The only time this is ever wrong is in print mode, so let's never show
pictures in print mode.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/divepicturewidget.cpp | 9 | ||||
-rw-r--r-- | qt-ui/divepicturewidget.h | 2 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 3 |
3 files changed, 8 insertions, 6 deletions
diff --git a/qt-ui/divepicturewidget.cpp b/qt-ui/divepicturewidget.cpp index cadbe04e6..fb3ae58e9 100644 --- a/qt-ui/divepicturewidget.cpp +++ b/qt-ui/divepicturewidget.cpp @@ -32,7 +32,7 @@ SPixmap scaleImages(const QString &s) return ret; } -void DivePictureModel::updateDivePictures(int divenr) +void DivePictureModel::updateDivePictures() { if (numberOfPictures != 0) { beginRemoveRows(QModelIndex(), 0, numberOfPictures - 1); @@ -40,15 +40,14 @@ void DivePictureModel::updateDivePictures(int divenr) endRemoveRows(); } - struct dive *d = get_dive(divenr); - numberOfPictures = dive_get_picture_count(d); - if (!d || numberOfPictures == 0) { + numberOfPictures = dive_get_picture_count(&displayed_dive); + if (numberOfPictures == 0) { return; } stringPixmapCache.clear(); QStringList pictures; - FOR_EACH_PICTURE (d) { + FOR_EACH_PICTURE (&displayed_dive) { stringPixmapCache[QString(picture->filename)].picture = picture; pictures.push_back(QString(picture->filename)); } diff --git a/qt-ui/divepicturewidget.h b/qt-ui/divepicturewidget.h index f0ddebed9..a0fd2693a 100644 --- a/qt-ui/divepicturewidget.h +++ b/qt-ui/divepicturewidget.h @@ -18,7 +18,7 @@ public: virtual int columnCount(const QModelIndex &parent = QModelIndex()) const; virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; - void updateDivePictures(int divenr); + void updateDivePictures(); private: DivePictureModel(); diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 05f592ab8..7a17fd7fb 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -1343,6 +1343,9 @@ void ProfileWidget2::keyEscAction() void ProfileWidget2::plotPictures() { + if (printMode) + return; + qDeleteAll(pictures); pictures.clear(); double x, y, lastX = -1.0, lastY = -1.0; |