diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-07-21 22:24:24 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-10-11 16:22:27 -0700 |
commit | ba9c35215e88dea0505e0f82531941797fc1ce7d (patch) | |
tree | 64cf80c41431651de4a5fb0020dd29aa94a6c625 /desktop-widgets/tab-widgets/maintab.h | |
parent | c30efc95d47291d8eadc6a5902eb5cc2a1dba13c (diff) | |
download | subsurface-ba9c35215e88dea0505e0f82531941797fc1ce7d.tar.gz |
Dive editing: don't repeatedly loop through whole dive list
On dive editing, for every changed field the code looped through
the whole dive-list and modified the selected dives. Instead,
get the list of selected dives once and use that.
Whereas this may look like a gratuitous optimization, it will
make things easier for subsequent commits. Notably, we can
pass the list of selected dives to an "UndoObject".
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/tab-widgets/maintab.h')
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/desktop-widgets/tab-widgets/maintab.h b/desktop-widgets/tab-widgets/maintab.h index d56661e77..c04a9b267 100644 --- a/desktop-widgets/tab-widgets/maintab.h +++ b/desktop-widgets/tab-widgets/maintab.h @@ -118,8 +118,9 @@ private: int lastTabSelectedDive; int lastTabSelectedDiveTrip; void resetPallete(); - void saveTags(); - void saveTaggedStrings(); + void copyTagsToDisplayedDive(); + void saveTags(const QVector<dive *> &selectedDives); + void saveTaggedStrings(const QVector<dive *> &selectedDives); void diffTaggedStrings(QString currentString, QString displayedString, QStringList &addedList, QStringList &removedList); void markChangedWidget(QWidget *w); dive_trip_t *currentTrip; |