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>
This commit is contained in:
Berthold Stoeger 2018-07-21 22:24:24 +02:00 committed by Dirk Hohndel
parent c30efc95d4
commit ba9c35215e
2 changed files with 61 additions and 44 deletions

View file

@ -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;