aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-10 06:31:37 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-10 06:31:37 -0800
commit585d6a004b4533c72ebfd70664571931dcc0ccd0 (patch)
tree4aa7663bcc9f42bb9710b1c56548759a3dabc80e /qt-ui
parentd60a6201931ed11e019e7582a6d6f72d6f4e0400 (diff)
downloadsubsurface-585d6a004b4533c72ebfd70664571931dcc0ccd0.tar.gz
Only update tags in the selected dives if they were changed
If current_dive and displayed_dive still have the same tags then we shouldn't touch the tags of other selected dives. Fixes #826 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/maintab.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 00aae5f29..88cfd8849 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -1099,6 +1099,9 @@ void MainTab::saveTags()
Q_FOREACH (const QString& tag, ui.tagWidget->getBlockStringList())
taglist_add_tag(&displayed_dive.tag_list, tag.toUtf8().data());
taglist_cleanup(&displayed_dive.tag_list);
+ // we need to check if the tags were changed before just overwriting them
+ if (taglist_equal(displayed_dive.tag_list, cd->tag_list))
+ return;
MODIFY_SELECTED_DIVES(
QString tag;
taglist_free(mydive->tag_list);