summaryrefslogtreecommitdiffstats
path: root/qt-mobile/qmlmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-mobile/qmlmanager.cpp')
-rw-r--r--qt-mobile/qmlmanager.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp
index df20de11d..7d50884ab 100644
--- a/qt-mobile/qmlmanager.cpp
+++ b/qt-mobile/qmlmanager.cpp
@@ -312,6 +312,17 @@ void QMLManager::loadDivesWithValidCredentials()
setLoadFromCloud(true);
}
+void QMLManager::refreshDiveList()
+{
+ int i;
+ struct dive *d;
+ DiveListModel::instance()->clear();
+ for_each_dive(i, d) {
+ DiveListModel::instance()->addDive(d);
+ }
+
+}
+
// update the dive and return the notes field, stripped of the HTML junk
QString QMLManager::commitChanges(QString diveId, QString date, QString location, QString gps, QString duration, QString depth,
QString airtemp, QString watertemp, QString suit, QString buddy, QString diveMaster, QString notes)
@@ -455,11 +466,7 @@ QString QMLManager::commitChanges(QString diveId, QString date, QString location
if (needResort)
sort_table(&dive_table);
if (diveChanged || needResort) {
- int i;
- DiveListModel::instance()->clear();
- for_each_dive(i, d) {
- DiveListModel::instance()->addDive(d);
- }
+ refreshDiveList();
mark_divelist_changed(true);
}
return notes;
@@ -501,7 +508,8 @@ QString QMLManager::getCurrentPosition()
void QMLManager::applyGpsData()
{
- locationProvider->applyLocations();
+ if (locationProvider->applyLocations())
+ refreshDiveList();
}
void QMLManager::sendGpsData()