aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlmanager.cpp
diff options
context:
space:
mode:
authorGravatar Joakim Bygdell <j.bygdell@gmail.com>2017-07-28 19:28:52 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-08-02 18:49:47 -0700
commit6a47af2d16c522575c79828f6a3e71e59de76d78 (patch)
treea187215959b518aa7d602ea4c8ddb286dee826d0 /mobile-widgets/qmlmanager.cpp
parent9d7eb33a33d6e7c21806057e700f0a00a43cbba5 (diff)
downloadsubsurface-6a47af2d16c522575c79828f6a3e71e59de76d78.tar.gz
QML UI: enable modification of ratings
This enables editing of visibility and ratings for a dive. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Diffstat (limited to 'mobile-widgets/qmlmanager.cpp')
-rw-r--r--mobile-widgets/qmlmanager.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index ed58fffb5..260f92649 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -832,7 +832,7 @@ bool QMLManager::checkDepth(DiveObjectHelper *myDive, dive *d, QString depth)
// update the dive and return the notes field, stripped of the HTML junk
void 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 weight, QString notes,
- QString startpressure, QString endpressure, QString gasmix, QString cylinder)
+ QString startpressure, QString endpressure, QString gasmix, QString cylinder, int rating, int visibility)
{
struct dive *d = get_dive_by_uniq_id(diveId.toInt());
DiveObjectHelper *myDive = new DiveObjectHelper(d);
@@ -936,6 +936,14 @@ void QMLManager::commitChanges(QString diveId, QString date, QString location, Q
free(d->divemaster);
d->divemaster = strdup(qPrintable(diveMaster));
}
+ if (myDive->rating() != rating) {
+ diveChanged = true;
+ d->rating = rating;
+ }
+ if (myDive->visibility() != visibility) {
+ diveChanged = true;
+ d->visibility = visibility;
+ }
if (myDive->notes() != notes) {
diveChanged = true;
free(d->notes);