core: make logfile_name and dumpfile_name std::string

To avoid memory management woes. These shouldn't be global
variables, but let's fix that later.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-03-16 10:29:05 +01:00 committed by bstoeger
parent 64419f2b19
commit 3a1122048b
6 changed files with 23 additions and 27 deletions

View file

@ -1481,10 +1481,8 @@ void ConfigureDiveComputerDialog::pickLogFile()
filename = fi.absolutePath().append(QDir::separator()).append("subsurface.log");
logFile = QFileDialog::getSaveFileName(this, tr("Choose file for dive computer download logfile"),
filename, tr("Log files") + " (*.log)");
if (!logFile.isEmpty()) {
free(logfile_name);
logfile_name = copy_qstring(logFile);
}
if (!logFile.isEmpty())
logfile_name = logFile.toStdString();
}
#ifdef BT_SUPPORT