summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tab-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-04-13 19:09:35 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-05-07 08:56:58 -0700
commit4ca2b8daea9ea4ab677abcd78e89dec21bc76ed8 (patch)
tree92dd50d8e771e329b8433eaa7ba96b79ace3c09c /desktop-widgets/tab-widgets
parent3b8b328639cd965c0664e2be4c981c4a8e5afd4d (diff)
downloadsubsurface-4ca2b8daea9ea4ab677abcd78e89dec21bc76ed8.tar.gz
desktop: use current_dive to save subtitles
The old code used displayed_dive. However, virtually all the displayed data is now derived from current_dive. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/tab-widgets')
-rw-r--r--desktop-widgets/tab-widgets/TabDivePhotos.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/desktop-widgets/tab-widgets/TabDivePhotos.cpp b/desktop-widgets/tab-widgets/TabDivePhotos.cpp
index db1b943e4..03351184f 100644
--- a/desktop-widgets/tab-widgets/TabDivePhotos.cpp
+++ b/desktop-widgets/tab-widgets/TabDivePhotos.cpp
@@ -111,6 +111,8 @@ void TabDivePhotos::recalculateSelectedThumbnails()
void TabDivePhotos::saveSubtitles()
{
+ if (!current_dive)
+ return;
if (!ui->photosView->selectionModel()->hasSelection())
return;
QModelIndexList indices = ui->photosView->selectionModel()->selectedRows();
@@ -127,7 +129,7 @@ void TabDivePhotos::saveSubtitles()
if (!duration)
continue;
struct membuffer b = { 0 };
- save_subtitles_buffer(&b, &displayed_dive, offset, duration);
+ save_subtitles_buffer(&b, current_dive, offset, duration);
char *data = detach_cstring(&b);
subtitlefile.open(QIODevice::WriteOnly);
subtitlefile.write(data, strlen(data));