From 0ee5c8f03a477b4712ff42cf9b0cca87b2e7c2d5 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Sat, 27 Jan 2024 09:09:25 -0500 Subject: [PATCH] downloader: use global divelog object The save_dives() function saves dives from the global divelog object. Use the same object when calling parse_file() so that we don't end up with an empty output log file. Signed-off-by: Richard Fuchs --- subsurface-downloader-main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/subsurface-downloader-main.cpp b/subsurface-downloader-main.cpp index 354ff1278..a71d5d4b1 100644 --- a/subsurface-downloader-main.cpp +++ b/subsurface-downloader-main.cpp @@ -41,7 +41,6 @@ int main(int argc, char **argv) QStringList files; QStringList importedFiles; QStringList arguments = QCoreApplication::arguments(); - struct divelog log; // set a default logfile name for libdivecomputer so we always get a logfile logfile_name = strdup("subsurface-downloader.log"); @@ -92,7 +91,7 @@ int main(int argc, char **argv) filesOnCommandLine = !files.isEmpty() || !importedFiles.isEmpty(); if (!files.isEmpty()) { qDebug() << "loading dive data from" << files; - parse_file(qPrintable(files.first()), &log); + parse_file(qPrintable(files.first()), &divelog); } print_files(); if (!quit) {