mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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 <dfx@dfx.at>
This commit is contained in:
parent
caf2f8c102
commit
0ee5c8f03a
1 changed files with 1 additions and 2 deletions
|
@ -41,7 +41,6 @@ int main(int argc, char **argv)
|
||||||
QStringList files;
|
QStringList files;
|
||||||
QStringList importedFiles;
|
QStringList importedFiles;
|
||||||
QStringList arguments = QCoreApplication::arguments();
|
QStringList arguments = QCoreApplication::arguments();
|
||||||
struct divelog log;
|
|
||||||
|
|
||||||
// set a default logfile name for libdivecomputer so we always get a logfile
|
// set a default logfile name for libdivecomputer so we always get a logfile
|
||||||
logfile_name = strdup("subsurface-downloader.log");
|
logfile_name = strdup("subsurface-downloader.log");
|
||||||
|
@ -92,7 +91,7 @@ int main(int argc, char **argv)
|
||||||
filesOnCommandLine = !files.isEmpty() || !importedFiles.isEmpty();
|
filesOnCommandLine = !files.isEmpty() || !importedFiles.isEmpty();
|
||||||
if (!files.isEmpty()) {
|
if (!files.isEmpty()) {
|
||||||
qDebug() << "loading dive data from" << files;
|
qDebug() << "loading dive data from" << files;
|
||||||
parse_file(qPrintable(files.first()), &log);
|
parse_file(qPrintable(files.first()), &divelog);
|
||||||
}
|
}
|
||||||
print_files();
|
print_files();
|
||||||
if (!quit) {
|
if (!quit) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue