summaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-10 09:39:51 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-10 09:42:28 -0700
commita8a8bcd86a01e006b3f45ce916ad626fe3efe70c (patch)
tree149eacc38486fc52524e5efef3ab48be270df99c /qt-ui/maintab.cpp
parent634df1a337f61f2b7fa7cb6195ac680411c620e2 (diff)
downloadsubsurface-a8a8bcd86a01e006b3f45ce916ad626fe3efe70c.tar.gz
Add helper functions to ensure we have sane tag lists
There should never be empty or duplicate tags on those lists. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r--qt-ui/maintab.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index f84c63ec2..6fc4db8df 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -934,9 +934,9 @@ void MainTab::on_timeEdit_timeChanged(const QTime &time)
void MainTab::saveTags()
{
struct dive *cd = current_dive;
- Q_FOREACH(const QString& tag, ui.tagWidget->getBlockStringList()){
+ Q_FOREACH (const QString& tag, ui.tagWidget->getBlockStringList())
taglist_add_tag(&displayed_dive.tag_list, tag.toUtf8().data());
- }
+ taglist_cleanup(&displayed_dive.tag_list);
MODIFY_SELECTED_DIVES(
QString tag;
taglist_free(mydive->tag_list);