mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
When editing trip data, only copy actual changes
We zero out the displayedTrip and only copy changed data into it; so a NULL value is not deleted text, it means there was no change. Fixes #805 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
5cc261311e
commit
ccfea0872d
1 changed files with 2 additions and 2 deletions
|
@ -721,11 +721,11 @@ void MainTab::acceptChanges()
|
|||
amount_selected = 1;
|
||||
} else if (MainWindow::instance() && MainWindow::instance()->dive_list()->selectedTrips().count() == 1) {
|
||||
/* now figure out if things have changed */
|
||||
if (!same_string(displayedTrip.notes, currentTrip->notes)) {
|
||||
if (displayedTrip.notes && !same_string(displayedTrip.notes, currentTrip->notes)) {
|
||||
currentTrip->notes = copy_string(displayedTrip.notes);
|
||||
mark_divelist_changed(true);
|
||||
}
|
||||
if (!same_string(displayedTrip.location, currentTrip->location)) {
|
||||
if (displayedTrip.location && !same_string(displayedTrip.location, currentTrip->location)) {
|
||||
currentTrip->location = copy_string(displayedTrip.location);
|
||||
mark_divelist_changed(true);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue