mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
downloader: save downloaded dives
Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
5e34531e32
commit
40311362f3
3 changed files with 14 additions and 1 deletions
|
@ -9,6 +9,8 @@
|
|||
#include "core/tag.h"
|
||||
#include "core/dive.h"
|
||||
#include "core/subsurface-string.h"
|
||||
#include "core/file.h"
|
||||
#include "core/trip.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QLoggingCategory>
|
||||
|
@ -37,6 +39,12 @@ int main(int argc, char **argv)
|
|||
QStringList files;
|
||||
QStringList importedFiles;
|
||||
QStringList arguments = QCoreApplication::arguments();
|
||||
struct dive_table dive_table = empty_dive_table;
|
||||
struct dive_site_table sites = empty_dive_site_table;
|
||||
struct device_table devices;
|
||||
struct filter_preset_table presets;
|
||||
|
||||
|
||||
|
||||
const char *default_directory = system_default_directory();
|
||||
const char *default_filename = system_default_filename();
|
||||
|
@ -83,8 +91,10 @@ int main(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
filesOnCommandLine = !files.isEmpty() || !importedFiles.isEmpty();
|
||||
if (!files.isEmpty())
|
||||
if (!files.isEmpty()) {
|
||||
qDebug() << "loading dive data from" << files;
|
||||
parse_file(qPrintable(files.first()), &dive_table, &trip_table, &sites, &devices, &presets);
|
||||
}
|
||||
print_files();
|
||||
if (!quit) {
|
||||
if (!empty_string(prefs.dive_computer.vendor) && !empty_string(prefs.dive_computer.product) && !empty_string(prefs.dive_computer.device)) {
|
||||
|
@ -93,6 +103,7 @@ int main(int argc, char **argv)
|
|||
cliDownloader(prefs.dive_computer.vendor, prefs.dive_computer.product, prefs.dive_computer.device);
|
||||
}
|
||||
}
|
||||
save_dives(qPrintable(files.first()));
|
||||
taglist_free(g_tag_list);
|
||||
parse_xml_exit();
|
||||
free((void *)default_directory);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue