mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
3b8b328639
commit
4ca2b8daea
1 changed files with 3 additions and 1 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Reference in a new issue