diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-11-13 17:14:22 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-11-13 17:15:28 -0800 |
commit | d65b756c4ff3cf929114d2a48d1a0aa22f481ed9 (patch) | |
tree | 446374484824af0165122bf00bc6adebb6d13ce3 /qt-mobile/qmlmanager.cpp | |
parent | 6124842b0c4e8e52a72434f78b4b4177c6e2474b (diff) | |
download | subsurface-d65b756c4ff3cf929114d2a48d1a0aa22f481ed9.tar.gz |
QML UI: add preference for webservice user id
This handles the user id for the Subsurface webservice for GPS location
tracking.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile/qmlmanager.cpp')
-rw-r--r-- | qt-mobile/qmlmanager.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index d2c105110..c00134f84 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -25,6 +25,7 @@ QMLManager::QMLManager() : setCloudUserName(prefs.cloud_storage_email); setCloudPassword(prefs.cloud_storage_password); setSaveCloudPassword(prefs.save_password_local); + setSsrfGpsWebUserid(prefs.userid); if (!same_string(prefs.cloud_storage_email, "") && !same_string(prefs.cloud_storage_password, "")) loadDives(); } @@ -39,6 +40,7 @@ void QMLManager::savePreferences() s.beginGroup("CloudStorage"); s.setValue("email", cloudUserName()); s.setValue("save_password_local", saveCloudPassword()); + s.setValue("subsurface_webservice_uid", ssrfGpsWebUserid()); if (saveCloudPassword()) s.setValue("password", cloudPassword()); s.sync(); @@ -55,6 +57,10 @@ void QMLManager::savePreferences() prefs.cloud_storage_password = strdup(qPrintable(cloudPassword())); } } + if (!same_string(prefs.userid, qPrintable(ssrfGpsWebUserid()))) { + free(prefs.userid); + prefs.userid = strdup(qPrintable(ssrfGpsWebUserid())); + } } void QMLManager::loadDives() @@ -213,3 +219,14 @@ void QMLManager::setCloudUserName(const QString &cloudUserName) m_cloudUserName = cloudUserName; emit cloudUserNameChanged(); } + +QString QMLManager::ssrfGpsWebUserid() const +{ + return m_ssrfGpsWebUserid; +} + +void QMLManager::setSsrfGpsWebUserid(const QString &userid) +{ + m_ssrfGpsWebUserid = userid; + emit ssrfGpsWebUseridChanged(); +} |