diff options
author | Jan Mulder <jlmulder@xs4all.nl> | 2018-01-28 17:39:01 +0100 |
---|---|---|
committer | Jan Mulder <jlmulder@xs4all.nl> | 2018-01-31 14:48:14 +0100 |
commit | e4c8d6968f7b0410c600b821df372c123539c71a (patch) | |
tree | 082ec4b0cf4202f6af37160005ce0e8b0c778a4b /mobile-widgets | |
parent | 494ad2654082d85846cb902556921ab62a6dbb14 (diff) | |
download | subsurface-e4c8d6968f7b0410c600b821df372c123539c71a.tar.gz |
mobile: introduce simple private helper updateAllGlobalLists()
As we need to update our new stringlist models on multiple
locations, just refactor them into a new function.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 6 | ||||
-rw-r--r-- | mobile-widgets/qmlmanager.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index d28fa11ae..08882c324 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -273,6 +273,11 @@ void QMLManager::openLocalThenRemote(QString url) appendTextToLog(QStringLiteral("have cloud credentials, trying to connect")); tryRetrieveDataFromBackend(); } + updateAllGlobalLists(); +} + +void QMLManager::updateAllGlobalLists() +{ buddyModel.updateModel(); emit buddyListChanged(); suitModel.updateModel(); emit suitListChanged(); divemasterModel.updateModel(); emit divemasterListChanged(); @@ -1101,6 +1106,7 @@ void QMLManager::changesNeedSaving() #elif !defined(Q_OS_IOS) saveChangesCloud(false); #endif + updateAllGlobalLists(); } void QMLManager::openNoCloudRepo() diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h index 17762e0a2..cd2efdb35 100644 --- a/mobile-widgets/qmlmanager.h +++ b/mobile-widgets/qmlmanager.h @@ -243,6 +243,7 @@ private: bool m_libdcLog; bool m_developer; bool m_btEnabled; + void updateAllGlobalLists(); #if defined(Q_OS_ANDROID) QString appLogFileName; |