diff options
Diffstat (limited to 'commands')
-rw-r--r-- | commands/command_edit.cpp | 10 | ||||
-rw-r--r-- | commands/command_edit.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/commands/command_edit.cpp b/commands/command_edit.cpp index 345ca0cfe..39b734438 100644 --- a/commands/command_edit.cpp +++ b/commands/command_edit.cpp @@ -685,6 +685,10 @@ PasteState::PasteState(dive *dIn, const dive *data, dive_components what) : d(dI } if (what.weights) copy_weights(&data->weightsystems, &weightsystems); + if (what.number) + number = data->number; + if (what.when) + when = data->when; } PasteState::~PasteState() @@ -725,6 +729,10 @@ void PasteState::swap(dive_components what) std::swap(cylinders, d->cylinders); if (what.weights) std::swap(weightsystems, d->weightsystems); + if (what.number) + std::swap(number, d->number); + if (what.when) + std::swap(when, d->when); } // ***** Paste ***** @@ -767,6 +775,8 @@ void PasteDives::undo() fields.chill = what.chill; fields.divesite = what.divesite; fields.tags = what.tags; + fields.datetime = what.when; + fields.nr = what.number; emit diveListNotifier.divesChanged(divesToNotify, fields); if (what.cylinders) emit diveListNotifier.cylindersReset(divesToNotify); diff --git a/commands/command_edit.h b/commands/command_edit.h index ab842a13c..257461c59 100644 --- a/commands/command_edit.h +++ b/commands/command_edit.h @@ -301,6 +301,8 @@ struct PasteState { tag_entry *tags; struct cylinder_table cylinders; struct weightsystem_table weightsystems; + int number; + timestamp_t when; PasteState(dive *d, const dive *data, dive_components what); // Read data from dive data for dive d ~PasteState(); |