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>
This commit is contained in:
Jan Mulder 2018-01-28 17:39:01 +01:00
parent 494ad26540
commit e4c8d6968f
2 changed files with 7 additions and 0 deletions

View file

@ -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()

View file

@ -243,6 +243,7 @@ private:
bool m_libdcLog;
bool m_developer;
bool m_btEnabled;
void updateAllGlobalLists();
#if defined(Q_OS_ANDROID)
QString appLogFileName;