mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: make manually added dives more like those added on desktop
By giving them a fake profile we can actually edit the dive profile in the desktop app. Fixes #998 Fixes #1000 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ff2f6d4082
commit
66b08f53f2
1 changed files with 9 additions and 0 deletions
|
@ -10,6 +10,7 @@
|
|||
#include "qt-models/divelistmodel.h"
|
||||
#include <gpslistmodel.h>
|
||||
#include "divelist.h"
|
||||
#include "device.h"
|
||||
#include "pref.h"
|
||||
#include "qthelper.h"
|
||||
#include "qt-gui.h"
|
||||
|
@ -502,6 +503,14 @@ QString QMLManager::commitChanges(QString diveId, QString date, QString location
|
|||
diveChanged = false; // because we already modified things
|
||||
}
|
||||
}
|
||||
if (d->maxdepth.mm == d->dc.maxdepth.mm &&
|
||||
d->maxdepth.mm > 0 &&
|
||||
same_string(d->dc.model, "manually added dive") &&
|
||||
d->dc.samples == 0) {
|
||||
// so we have depth > 0, a manually added dive and no samples
|
||||
// let's create an actual profile so the desktop version can work it
|
||||
d->dc = *fake_dc(&d->dc);
|
||||
}
|
||||
if (diveChanged)
|
||||
DiveListModel::instance()->updateDive(oldIdx, d);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue