From 4b2cae3f7c0702809dbce3af301667805e5fbcd3 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Sun, 8 Dec 2019 09:23:45 +0100 Subject: mobile-widgets: make upload signals available to QML Connect signal to signal in QMLManager to avoid registring the upload class. Signed-off-by: Jan Iversen --- mobile-widgets/qmlmanager.cpp | 6 ++++++ mobile-widgets/qmlmanager.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 21507c278..9d6472398 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -161,6 +161,12 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false), timer.start(); connect(qobject_cast(QApplication::instance()), &QApplication::applicationStateChanged, this, &QMLManager::applicationStateChanged); + // make upload signals available in QML + connect(uploadDiveLogsDE::instance(), &uploadDiveLogsDE::uploadFinish, + this, &QMLManager::uploadFinish); + connect(uploadDiveLogsDE::instance(), &uploadDiveLogsDE::uploadProgress, + this, &QMLManager::uploadProgress); + #if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) #if defined(Q_OS_ANDROID) // on Android we first try the GenericDataLocation (typically /storage/emulated/0) and if that fails diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h index 4653c47a5..862a7c894 100644 --- a/mobile-widgets/qmlmanager.h +++ b/mobile-widgets/qmlmanager.h @@ -294,6 +294,10 @@ signals: void pluggedInDeviceNameChanged(); void showNonDiveComputersChanged(); void DC_ForceDownloadChanged(); + + // From upload process + void uploadFinish(bool success, const QString &text); + void uploadProgress(qreal percentage); }; #endif -- cgit v1.2.3-70-g09d2