diff options
author | jan Iversen <jan@casacondor.com> | 2019-12-08 09:23:45 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-12-11 12:36:43 -0500 |
commit | 4b2cae3f7c0702809dbce3af301667805e5fbcd3 (patch) | |
tree | e2cec91a39e96b848af41de0c2dc580fae18f37f /mobile-widgets | |
parent | 5cba410aa616e26edda6c2b97a9b9bcc611d3312 (diff) | |
download | subsurface-4b2cae3f7c0702809dbce3af301667805e5fbcd3.tar.gz |
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 <jan@casacondor.com>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 6 | ||||
-rw-r--r-- | mobile-widgets/qmlmanager.h | 4 |
2 files changed, 10 insertions, 0 deletions
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 *>(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 |