mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
9d7eb33a33
commit
6a47af2d16
3 changed files with 38 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue