diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-08-31 15:05:11 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-09-06 11:48:47 -0700 |
commit | f27d440bb39be201451d6066401e7c993c8223fa (patch) | |
tree | b489b8a070f2b69cd8a3817a363a7363d58253db /qt-models/divetripmodel.h | |
parent | 093adf1ea88dbcab465051b28f8a60a3a29f7a87 (diff) | |
download | subsurface-f27d440bb39be201451d6066401e7c993c8223fa.tar.gz |
Dive site: don't emit divesChanged signals when editing dive site
When editing the dive site, for certain fields a divesChanged signal
was emitted so that the dive-list can be updated.
Arguably it is wrong to decide which fields are relevant to the
dive list in the undo-command code. Therefore, let the list
catch the dive-site-edited signal and decide itself.
But the actual reason for this commit is that if the dive-site
field of a dive changes, we might have to reload the dive-location-model
because suddenly a new dive site appears. Now if this is done
in QML context on some Qt version (notably 5.9) we get crashes
later on. But that can happen if the user moves a flag. So in that
case only send a diveSiteChanged signal.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/divetripmodel.h')
-rw-r--r-- | qt-models/divetripmodel.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/qt-models/divetripmodel.h b/qt-models/divetripmodel.h index 8ddcf9615..b63456236 100644 --- a/qt-models/divetripmodel.h +++ b/qt-models/divetripmodel.h @@ -106,6 +106,7 @@ public slots: void divesAdded(dive_trip *trip, bool addTrip, const QVector<dive *> &dives); void divesDeleted(dive_trip *trip, bool deleteTrip, const QVector<dive *> &dives); void divesMovedBetweenTrips(dive_trip *from, dive_trip *to, bool deleteFrom, bool createTo, const QVector<dive *> &dives); + void diveSiteChanged(dive_site *ds, int field); void divesChanged(const QVector<dive *> &dives); void divesTimeChanged(timestamp_t delta, const QVector<dive *> &dives); void divesSelected(const QVector<dive *> &dives, dive *current); @@ -170,6 +171,7 @@ class DiveTripModelList : public DiveTripModelBase public slots: void divesAdded(dive_trip *trip, bool addTrip, const QVector<dive *> &dives); void divesDeleted(dive_trip *trip, bool deleteTrip, const QVector<dive *> &dives); + void diveSiteChanged(dive_site *ds, int field); void divesChanged(const QVector<dive *> &dives); void divesTimeChanged(timestamp_t delta, const QVector<dive *> &dives); // Does nothing in list view. |