mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
desktop: use std::string to format subtitles
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
d05e289507
commit
6252d22adf
3 changed files with 33 additions and 30 deletions
|
@ -12,7 +12,6 @@
|
|||
#include <QUrl>
|
||||
#include <QMessageBox>
|
||||
#include <QFileInfo>
|
||||
#include "core/membuffer.h"
|
||||
#include "core/save-profiledata.h"
|
||||
#include "core/selection.h"
|
||||
|
||||
|
@ -131,11 +130,9 @@ void TabDivePhotos::saveSubtitles()
|
|||
// Only videos have non-zero duration
|
||||
if (!duration)
|
||||
continue;
|
||||
membuffer b;
|
||||
save_subtitles_buffer(&b, parent.currentDive, offset, duration);
|
||||
const char *data = mb_cstring(&b);
|
||||
std::string buffer = save_subtitles_buffer(parent.currentDive, offset, duration);
|
||||
subtitlefile.open(QIODevice::WriteOnly);
|
||||
subtitlefile.write(data, strlen(data));
|
||||
subtitlefile.write(buffer.c_str(), buffer.size());
|
||||
subtitlefile.close();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue