From e4c8d6968f7b0410c600b821df372c123539c71a Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Sun, 28 Jan 2018 17:39:01 +0100 Subject: [PATCH] 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 --- mobile-widgets/qmlmanager.cpp | 6 ++++++ mobile-widgets/qmlmanager.h | 1 + 2 files changed, 7 insertions(+) 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;