mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
Set the Cylinders and Weigths to all selected dives after pressing 'Accept'
This bit of magic actually performs the save on the dive list for the changed weigths and cylinders, it will set the cylinders only if there's a change on the cylinder model, and it will set the weight only if there's a change in the weigth model. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
parent
8ce5d91dfe
commit
d9067582a9
1 changed files with 18 additions and 1 deletions
|
@ -431,8 +431,25 @@ void MainTab::acceptChanges()
|
|||
mainWindow()->globe()->reload();
|
||||
mainWindow()->globe()->centerOn(current_dive);
|
||||
}
|
||||
if (cylindersModel->changed || weightModel->changed)
|
||||
|
||||
if (cylindersModel->changed) {
|
||||
mark_divelist_changed(TRUE);
|
||||
Q_FOREACH(dive *d, notesBackup.keys()){
|
||||
for(int i = 0; i < MAX_CYLINDERS; i++){
|
||||
d->cylinder[i] = multiEditEquipmentPlaceholder.cylinder[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (weightModel->changed) {
|
||||
mark_divelist_changed(TRUE);
|
||||
Q_FOREACH(dive *d, notesBackup.keys()){
|
||||
for(int i = 0; i < MAX_CYLINDERS; i++){
|
||||
d->cylinder[i] = multiEditEquipmentPlaceholder.cylinder[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (editMode == ADD) {
|
||||
// clean up the dive data (get duration, depth information from samples)
|
||||
|
|
Loading…
Reference in a new issue