diff options
author | jan Iversen <jan@casacondor.com> | 2019-12-08 11:52:38 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-12-12 21:35:55 -0500 |
commit | 53069fe777f123697f6d7d06e1f86ebbd5366b40 (patch) | |
tree | ea329e20c221b47c0b208061a79a79e433700112 /mobile-widgets/qmlmanager.cpp | |
parent | dd183eaabf949624adcf89818fac4c32f624d178 (diff) | |
download | subsurface-53069fe777f123697f6d7d06e1f86ebbd5366b40.tar.gz |
mobile-widgets: activate uploadDiveShare in qmlmanager
Remove "TO BE IMPLEMENTED" and add call doUpload
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/qmlmanager.cpp')
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 9d6472398..d9133a4ce 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -48,6 +48,7 @@ #include "core/exportfuncs.h" #include "core/worldmap-save.h" #include "core/uploadDiveLogsDE.h" +#include "core/uploadDiveShare.h" QMLManager *QMLManager::m_instance = NULL; @@ -166,6 +167,14 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false), this, &QMLManager::uploadFinish); connect(uploadDiveLogsDE::instance(), &uploadDiveLogsDE::uploadProgress, this, &QMLManager::uploadProgress); + connect(uploadDiveShare::instance(), &uploadDiveShare::uploadProgress, + this, &QMLManager::uploadProgress); + + // uploadDiveShare::uploadFinish() is defined with 3 parameters, + // whereas QMLManager::uploadFinish() is defined with 2 paramters, + // Solution add a slot as landing zone. + connect(uploadDiveShare::instance(), SIGNAL(uploadDiveShare::uploadFinish(bool, const QString &, const QByteArray &)), + this, SLOT(uploadFinishSlot(bool, const QString &, const QByteArray &))); #if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) #if defined(Q_OS_ANDROID) @@ -2201,13 +2210,16 @@ void QMLManager::exportToWEB(export_types type, QString userId, QString password uploadDiveLogsDE::instance()->doUpload(false, userId, password); break; case EX_DIVESHARE: - // TO BE IMPLEMENTED - // Current call in Desktop-widgets - // DiveShareExportDialog::instance()-> - // prepareDivesForUpload(ui->exportSelected->isChecked()); + uploadDiveShare::instance()->doUpload(false, userId, anonymize); break; default: qDebug() << "upload to unknown type " << type << " using " << userId << "/" << password << " remove names " << anonymize; break; } } + +void QMLManager::uploadFinishSlot(bool success, const QString &text, const QByteArray &html) +{ + emit uploadFinish(success, text); +} + |