From a7e1e7fee1c2afc61b37a0bea76032d169dcee7a Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 12 Oct 2014 06:57:32 -0400 Subject: [PATCH] Pass the whole 'device_data_t' to the uemis downloader Not only does it make it look more like the libdivecomputer downloaders, but the uemis downloader needs it in order to support all the flags we have. Notably "download into private trip". Signed-off-by: Linus Torvalds Signed-off-by: Dirk Hohndel --- libdivecomputer.h | 2 +- qt-ui/downloadfromdivecomputer.cpp | 2 +- uemis-downloader.c | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libdivecomputer.h b/libdivecomputer.h index f277e298f..af51854a0 100644 --- a/libdivecomputer.h +++ b/libdivecomputer.h @@ -33,7 +33,7 @@ typedef struct device_data_t } device_data_t; const char *do_libdivecomputer_import(device_data_t *data); -const char *do_uemis_import(const char *mountpath, short force_download); +const char *do_uemis_import(device_data_t *data); extern int import_thread_cancelled; extern const char *progress_bar_text; diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp index fe5d4ee9a..112d10586 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp @@ -477,7 +477,7 @@ void DownloadThread::run() const char *errorText; import_thread_cancelled = false; if (!strcmp(data->vendor, "Uemis")) - errorText = do_uemis_import(data->devname, data->force_download); + errorText = do_uemis_import(data); else errorText = do_libdivecomputer_import(data); if (errorText) diff --git a/uemis-downloader.c b/uemis-downloader.c index 608d3c6ea..4e0545193 100644 --- a/uemis-downloader.c +++ b/uemis-downloader.c @@ -824,8 +824,10 @@ static char *uemis_get_divenr(char *deviceidstr) return strdup(divenr); } -const char *do_uemis_import(const char *mountpath, short force_download) +const char *do_uemis_import(device_data_t *data) { + const char *mountpath = data->devname; + short force_download = data->force_download; char *newmax = NULL; int start, end = -2, i, offset; uint32_t deviceidnr;