diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-04-13 19:09:35 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-05-07 08:56:58 -0700 |
commit | 4ca2b8daea9ea4ab677abcd78e89dec21bc76ed8 (patch) | |
tree | 92dd50d8e771e329b8433eaa7ba96b79ace3c09c /desktop-widgets/tab-widgets | |
parent | 3b8b328639cd965c0664e2be4c981c4a8e5afd4d (diff) | |
download | subsurface-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.cpp | 4 |
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)); |