diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-02-11 15:34:43 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-12 18:19:07 +0300 |
commit | cddd5942f8accaa612d8e107b45c1bf3d47a5c95 (patch) | |
tree | 12fccf925d13078caa338f3c72332e9a3ec0cd79 /core/subsurface-qt | |
parent | d5691cd7cba5ffac6ffe1b6e85802abfc262decc (diff) | |
download | subsurface-cddd5942f8accaa612d8e107b45c1bf3d47a5c95.tar.gz |
Undo: update dive list after edit command
The dive list was not updated automatically when an edit command was
executed. There was already a signal to do that, viz. divesChanged().
But that signal worked by-trip and didn't have a dive-field specifier.
The edit-commands used the divesEdited() signal that isn't by-trip
but has a dive-field specifier.
Unify these two signals to be by-trip and with dive-field specifier.
This needs common code to generate the by-trip list that is moved to
a command_private.h header.
Since there might now be multiple signals (one per trip) actually
check in the main-tab whether the current trip is affected to
avoid multiple update of fields. This has the positive(?) effect
of not doing any update if the current dive isn't changed.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/subsurface-qt')
-rw-r--r-- | core/subsurface-qt/DiveListNotifier.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/core/subsurface-qt/DiveListNotifier.h b/core/subsurface-qt/DiveListNotifier.h index d9ef4152b..53009410e 100644 --- a/core/subsurface-qt/DiveListNotifier.h +++ b/core/subsurface-qt/DiveListNotifier.h @@ -13,6 +13,7 @@ // Dive fields that can be edited. // Use "enum class" to not polute the global name space. enum class DiveField { + NR, DATETIME, DEPTH, DURATION, @@ -46,7 +47,7 @@ signals: // - The "trip" arguments are null for top-level-dives. void divesAdded(dive_trip *trip, bool addTrip, const QVector<dive *> &dives); void divesDeleted(dive_trip *trip, bool deleteTrip, const QVector<dive *> &dives); - void divesChanged(dive_trip *trip, const QVector<dive *> &dives); + void divesChanged(dive_trip *trip, const QVector<dive *> &dives, DiveField field); void divesMovedBetweenTrips(dive_trip *from, dive_trip *to, bool deleteFrom, bool createTo, const QVector<dive *> &dives); void divesTimeChanged(dive_trip *trip, timestamp_t delta, const QVector<dive *> &dives); @@ -69,9 +70,6 @@ signals: void diveSiteDiveCountChanged(dive_site *ds); void diveSiteChanged(dive_site *ds, int field); // field according to LocationInformationModel void diveSiteDivesChanged(dive_site *ds); // The dives associated with that site changed - - // Signals emitted when dives are edited. - void divesEdited(const QVector<dive *> &dives, DiveField); public: // Desktop uses the QTreeView class to present the list of dives. The layout // of this class gives us a very fundamental problem, as we can not easily |