From 4ca2b8daea9ea4ab677abcd78e89dec21bc76ed8 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 13 Apr 2020 19:09:35 +0200 Subject: 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 Signed-off-by: Dirk Hohndel --- desktop-widgets/tab-widgets/TabDivePhotos.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)); -- cgit v1.2.3-70-g09d2