diff options
-rw-r--r-- | core/libdivecomputer.c | 3 | ||||
-rw-r--r-- | core/libdivecomputer.h | 1 | ||||
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 1 |
3 files changed, 5 insertions, 0 deletions
diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c index a44e4a1ca..6361a593e 100644 --- a/core/libdivecomputer.c +++ b/core/libdivecomputer.c @@ -37,6 +37,7 @@ char *dumpfile_name; char *logfile_name; const char *progress_bar_text = ""; +void (*progress_callback)(const char *text) = NULL; double progress_bar_fraction = 0.0; static int stoptime, stopdepth, ndl, po2, cns; @@ -484,6 +485,8 @@ static void dev_info(device_data_t *devdata, const char *fmt, ...) vsnprintf(buffer, sizeof(buffer), fmt, ap); va_end(ap); progress_bar_text = buffer; + if (progress_callback) + (*progress_callback)(buffer); } static int import_dive_number = 0; diff --git a/core/libdivecomputer.h b/core/libdivecomputer.h index 83a6bab79..3986b629e 100644 --- a/core/libdivecomputer.h +++ b/core/libdivecomputer.h @@ -52,6 +52,7 @@ dc_descriptor_t *get_descriptor(dc_family_t type, unsigned int model); extern int import_thread_cancelled; extern const char *progress_bar_text; +extern void (*progress_callback)(const char *text); extern double progress_bar_fraction; extern char *logfile_name; extern char *dumpfile_name; diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 5aa0451f8..f0586bdf6 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -93,6 +93,7 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false), setShowPin(false); // create location manager service locationProvider = new GpsLocation(&appendTextToLogStandalone, this); + progress_callback = &appendTextToLogStandalone; connect(locationProvider, SIGNAL(haveSourceChanged()), this, SLOT(hasLocationSourceChanged())); setLocationServiceAvailable(locationProvider->hasLocationsSource()); set_git_update_cb(&gitProgressCB); |